How do I make AI enemyes...

Get help using Construct 2

Post » Fri Oct 17, 2014 3:51 pm

How can I make enemies like in this game. https://www.youtube.com/watch?v=BuXOSBb4hQw
I need them walking arround...following the player and if needed JUMPING trough platforms...or falling from platforms...

thanks

guys
B
37
S
16
G
2
Posts: 447
Reputation: 4,865

Post » Sat Oct 18, 2014 10:20 am

apply this see if it is what you wanted: if(playerX > enemyX) Then increase enemyX. if(playerY > enemeyY ) Then Jump to platform. so basically how i would do it have it spawn then every second or so have the X of the enemy change to match that of the player. Have the Y of the enemy change depending on wether the player is above or below them. You could also set it so that if the player.X is over say 10 pixels that the enemy should just walk around randomly. Hope this helps.

AL
B
2
Posts: 2
Reputation: 154

Post » Sat Oct 18, 2014 11:49 am

...do u think there could be a capx file somewhere ?

thanks 4 the help :)
B
37
S
16
G
2
Posts: 447
Reputation: 4,865

Post » Sat Oct 18, 2014 11:56 am

Depends on how "smart" you want your enemies to be..

Checking the position of each enemy compared to the position of the player and adding actions based on that would be the starting point..
By adding more conditions you could make the enemy smarter or dumber..
One idea would be to place detection-sprites at the ends of platforms and if enemy is overlapping and player.y<enemy.y have them jump down..
Jumping up and through a platform is only possible if there is a platform above, so checking for overlapping at offset (or any other way that suits you) and basing the jumping action on that could work..
Perhaps adding the timer behaviour to have the enemies "make decisions" at certain intevals would be of help (this could also prevent the enemies from going crazy)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 19, 2014 4:55 am

thanks :)
B
37
S
16
G
2
Posts: 447
Reputation: 4,865


Return to How do I....?

Who is online

Users browsing this forum: David181, jorgmaquoi, unicornspitfire and 21 guests