I am making a platform game and currently Ive got working melee enemies. And I would like to know how to make when enemy is at X distance of pixels that he stops and starts shooting at me.
you can use the system compare action to look at the player.x and player.y vs. the enemy.x and enemy.y and if it is less than a certain amount, have the enemy stop and fire.
Develop games in your browser. Powerful, performant & highly capable.
could you give me a small example pls, judging by what you said it seems like the thing i need
There is also the distance() function you can use to compare the distance between 2 coordinates
Where? I tried to find it but is it under conditions or actions, and under system or just some sprite in general?
I made a small example. Maybe that can help you understand.
https://dl.dropboxusercontent.com/u/2560922/mobiledev/forum/platformerStopAtRange.capx
Thanks exactly what i needed. Didnt know it was that easy XD