Enemy bounce off player and then return to place?

Get help using Construct 2

Post » Wed Apr 30, 2014 6:53 am

I'm trying to figure out how to place an enemy with something simple like Sine movement, but when the enemy is struck with the players sword or comes in to collision with the player it will bounce off or get knocked back.

This is doable, but the biggest issue I run in to is trying to have the enemy then return to the place it started at. I'm trying to keep it simple and make these enemies flying/floating type to avoid platform ai issues.

I've used the bullet behavior but I'm guessing that I'll need to do that with a combo of path detection or something.

Has anyone done this or know how to?
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Wed Apr 30, 2014 10:28 am

if player got hit then
set value(player.oldY)to(player.Y)
set player.bullet.angle to 270
set player.bullet enable

if player bullet=enable & if player.bullet.angle=270 & if player.Y - player.oldY > 100
set player.bullet.angle to 90

if player bullet=enable & if player.bullet.angle=90 & if player.Y = player.oldY
set player.bullet disable
B
17
S
7
Posts: 360
Reputation: 2,202


Return to How do I....?

Who is online

Users browsing this forum: Alvaro2 and 15 guests