Random enemy movement (4-direction only)

Get help using Construct 2

Post » Thu Aug 15, 2013 3:25 am

My enemy Robots walk only in four directions (up, down, left, right). Using the code in the screenshot, he randomly moves in one of these four directions every 2-5 seconds.

Please right-click, on this image, and you can view it:


The problem: When the game loads, all of the Robots on the screen move to the top of the screen, and then will start the random movement process. How do I solve this?

Another issue: The Robots will continue walking until they hit a solid. How can I make it so the Robots randomly stop in various locations even if it's not a solid that stops them?

Additional thing wanted: I would like the Robots to start following the Player when they come within a certain distance of the player.

I have read and tested many of the other enemy movement tutorials and forum posts on this site, and all of the ones I have seen are for Platform movement, or for 8-Direction movement, or for Sine movement, or for Pathfinding movement. Is there an easy way to do this with the 4-direction movement I am using?

Thank you for your help!DoomEyes2013-08-15 16:13:30
B
7
S
2
Posts: 34
Reputation: 670

Post » Thu Aug 15, 2013 10:58 am

Can you link me to the .capx please?
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests