GameMaker When Player doesn't go to death room

S

Sroft

Guest
I have my player when there hp reaches 0 they should be transported to a room, I'm sure its an easy fix, I'm just lost at the moment
Player create-
//move vari
hsp = 0;
vsp = 0;
grv = 0.3;
walksp = 4;
hascontrol = true;
PlayerHP = 100;
//weapons
enum WEAPONS_MODE
{
HANDS,
PLASMA
}
weapons = WEAPONS_MODE.HANDS
//Guns
firing = 0;
ShootCont = true

Player step
if ( PlayerHP <= 0)
{
room_goto(DeadRoom)
}

also if there is a way to do hp better than what I am doing currently, I would appreciate advice on how to make it better (right now they player takes damage when the player collides with an enemy)

Enemy collision event with Player
with (other)
{
PlayerHP -= 1;
}
thank you
 
T

Taddio

Guest
Looks fine at first glance. Add show_debug_message("Player HP is 0");
after room_goto() (in the same brackets), just to make sure the event triggers.
 
Top