Thank you all. I use the script from JohnDoeNews and have shortened it a bit. I also managed with little tricks that everything turned out the way I want it to be.
By the way, this is the script I'm using:
var x = Math.abs($gameMap.event(1).x - $gameMap.event(2).x), y = Math.abs($gameMap.event(1).y - $gameMap.event(2).y); (x == 1 && y == 0) || (x == 0 && y == 1);
Okay. I was going to say you need them again with -1, but then I saw a Math extension I don't know yet. I googled it to see if this would always show the difference as positive, and it does.
🙂 This is very useful to know.
So I guess we learned from each other at the same time.
I like how my original code gets shorter and shorter, btw. First there is an idea, than there is the logic, than there is the finishing touch.
🙂
However, I see a tiny mistake in the code. "), y = Math" must be "); var y = Math"
Edit, okay, I learned 2 things today.
😛 After I wrote the reply, I thought: "Or would that work too?", and it did! Seriously, I feel like such a noob today.
😛