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?
Posts: 150
Reputation: 1,965

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
Posts: 360
Reputation: 2,202

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 65 guests