• 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!

removing collision between player and the other objects

A

ajater

Guest
I have a simple platform game where there is a counted time, and if the time is up the player should fall dawn and lose,

and I am using this code for losing in the step event of the player:

if (global.lose)
{
sprite_index = sp_lose
gravity = 1;
exit;
}
else


but the problem is when the player fall down it stuck with ground and another objects such as stairs,

and I want to remove any collision between the player and the other objects.

any help will be appreciated.
 

NightFrost

Member
In situations like this, I usually create a separate object for death animation. It has a mostly empty step event except, if necessary, code to make it fall and play out some animation. When player dies I destroy player and spawn this object in same spot.
 
N

NeZvers

Guest
If you don't have many characters then @NightFrost suggestion is easiest way to go (probably using instance_change()). Other direction would be simply put
Code:
if(!global.loose)
{
 ///Collision code
}
And another option would be a loosing state in the state machine without collision.
 

TheouAegis

Member
Set sprite_index to -1 and draw the player in the End Draw event if the sprite_index is -1.

If you use masks, also set mask_index to -1.
 
Top