V
ValDCX
Guest
Hi everybody,
I'm very new here and I am a beginner with Game Maker.
I'm trying to make a top down game, but I can't manage to get the player knockback working. I want the player to be knocked back by enemies when he touches them, so I created a collision event in the enemy object and used this code:
obj_player.speed = -10
alarm [0] = 5
Then i made an alarm event :
obj_player.speed += 10;
But when I touch an enemy, my character is not knocked back, but knocked left instead. I dont know what to do, does somebody have an idea ? Thanks.
I'm very new here and I am a beginner with Game Maker.
I'm trying to make a top down game, but I can't manage to get the player knockback working. I want the player to be knocked back by enemies when he touches them, so I created a collision event in the enemy object and used this code:
obj_player.speed = -10
alarm [0] = 5
Then i made an alarm event :
obj_player.speed += 10;
But when I touch an enemy, my character is not knocked back, but knocked left instead. I dont know what to do, does somebody have an idea ? Thanks.