How do i make enemies bounce while moving forward?

Get help using Construct 2

Post » Tue Aug 13, 2013 10:25 am

Hey everyone!

I've been trying to make my enemies bounce while moving forward towards the player. This means moving in both X and Y directions and please note that this is NOT a platform game so there aren't any solid platforms to stand on. It's more of a top-down game and below is my current code:

At the moment I can see this working in one out of two ways:

1.) I use gravity and make the enemy jump up. The problem is that the bounce needs to be stopped where it started (in Y axis) and this is the way i have it now -- a nice bounce in place effect. The problem is that the enemy can't move in the Y axis towards the enemy because this interferes with the bounce. Also the gravity messes things up.

2.) I make an animation that looks like a bounce and then move the enemy towards the player by calculating distance and the amount to move each frame. While doing this i just run the animation over and over. The problem with this is that the animation only can change one pixel per step so it becomes very jerky.

I would prefer to have it bounce "naturally" by utilizing gravity since i believe this would look smoother, but since there are no platforms or solids to bounce on, this has presented a problem for me. Any suggestions would be awesome!hdnine2013-08-13 11:56:41
Posts: 38
Reputation: 555

Post » Tue Aug 13, 2013 2:30 pm

I'm confused here, if it's a top-down game wouldn't the bouncing be on Z axis, and movement up down left right is on X,Y? If that's the case then I would just use sprites to simulate bouncing from a top-down perspective.
Posts: 2,421
Reputation: 55,530

Return to How do I....?

Who is online

Users browsing this forum: grigrizljac and 5 guests