• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Bouncing against each other

J

James7285

Guest
Hello,

I'm very new to GM so bare with me a little. I have done a few tutorials to get me started but I have now decided to make my own game.

To keep it simple I want to do a top down version of a mini game from Kung Fu Kaos (old xbox game). The idea is players can move around a platform and you have to bump the other players off.

Here is a video of the game I mean.... (from 3:22 onwards)


I have finished doing the movement so that it feels like you're sliding around. I have put a second player into the room and now I'm trying to set it up so that when they collide into each other they both bounce off.

In my player1 object I have a bit of code that is run when you collide with player2 which is just "move_bounce_all(false);". What I now can't work out is how to make player2 bounce as well. As it stands player 1 bounces backwards and player2 just stays exactly where it is.

Any help would be much appreciated.

Thanks
James
 
A

Aura

Guest
Do the same with player2? On collision with player1, use the same code. ^^"
 
J

James7285

Guest
Hi,

Thanks for the reply.
I have set the same code for player2 as well. At the moment if you run player1 into player2, player1 bounces away and player2 stays static. If you bounce player2 into player1, player2 bounces away and player1 stays static.

I want it so that if either of them bump into each other they both bounce away.
 
J

James7285

Guest
I think I have got a little further in this issue but not quite resolved it yet. I have got rid of the bounce command and I have now done the following:

When player1 hits collides with player2 this happens:
motion_set(obj_player1.direction + 180,8)

When player2 collides with player1 this happens:
motion_set(obj_player2.direction + 180,8)

This works fine for a head on collision, they both bounce away from each other. My only problem is that if player1 goes into the back of player2, player2 does a 180 straight into player one and they get stuck together!

I think using the motion_set is the right answer, I just need them to bounce away from each other no matter what angle they hit at.

Any ideas?
Maybe there is a way to pick up the point of collision and set the angle away from that?
 
Top