0 Favourites

How do you bounce your main actor in a top down?

• 5 posts
• Hello all.

I have a round-shaped main character who is in a top down game. There are other round-shaped NPCs in the game, NPCs who move. When the main character and the NPCs collide I wish to have them both bounce away from each other.

In order to try to make this happen I have tried the following...

Given both of them physics and tried adjusting the elasticity and density of the objects.

Created an event where upon collision an impulse tries to push the player away from the impact.

With everything I've tried, the main character just pushes through the NPC with no real impeding of its movement, or the NPCs get thrown away violently.

Am I missing something? Is there any way to do this?

• Have you looked into the bullet behavior? It doesn't have to be used for movement, it gives you the "bounce off object" action you can call yourself on both who collide.

• if you still want to use physics

leave events completely.. just give both elasticity of somewhere between 0.5 and 1

also, linear damping is normally for the effects of air resistance... but for a top down game you should treat this like it's the character acceleration/deaccel. So set it relatively high.

it lets you have a reasonably fast player without feeling slidey

• Thank you both for your replies.

I've been tinkering around with physics and it seems that if your character is travelling right and hits something whilst you're still holding down the right key, you don't bounce. It's like the holding of the right key overrides the bounce action. I've tried momentarily turning off the 8Direction upon collision but it produces very haphazard results.

I tried Bullet motion for moving the character, leaving 8Direction completely alone, and that seems to work. The only difficulty is if you want to change the speed of the character you need to change the density and linear damping to avoid some very wacky results. It's a shame that my game requires a high number of speed changes!! <img src="smileys/smiley5.gif" border="0" align="middle" />

I think this is going to take a lot more testing. If you have any more ideas I'd be most appreciative, though!!

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Bullet is not working either. The best way seems to apply force by using physics. That way you don't have a defined speed to override the impact. Very touchy to adjust, though.

• 5 posts