AI move opposition direction with wall collision

Get help using Construct 2

Post » Mon Oct 29, 2012 9:54 pm

Hey i began using construct 2 a couple of days ago and so far its great. At the moment im working on a simple platformer and was wondering how I can make it to an AI will when they collide with a wall, will move the opposite direction.

I was able to partially do this by doing the event "on collision with another object." For the action i did rotate clockwise 180 degrees. This worked however when the AI went to one side it would go upside down on its way to the next wall and then go back to normal when it collided with another wall and so on...

I want to be able to create the same effect as mobs in mario games such as goomba's who go back and forth when colliding with walls etc.

Thanks :)

edit: also forgot to say that i use the bullet movement to move the AI. DeadlyCheese2012-10-29 22:07:04
B
4
Posts: 9
Reputation: 468

Post » Mon Oct 29, 2012 10:11 pm

Use a combination of flipping/mirroring/rotating to make sure it goes the correct way.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Mon Oct 29, 2012 10:13 pm

Have a look at the enemy movement part of the platform tutorial.
http://www.scirra.com/tutorials/253/how-to-make-a-platform-game
Page 7.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Mon Oct 29, 2012 10:14 pm

thanks for your help :)
B
4
Posts: 9
Reputation: 468


Return to How do I....?

Who is online

Users browsing this forum: armaldio, blackhornet, ETgirl79, TiagoCesar and 19 guests