A
Andrew Lee Kirkman
Guest
I am currently using GML and the code I have looks like this:
if (obj_player_one.state = PLAYERSTATE.PLAYERDOWNED){
if (obj_player_one.x = obj_player_two.x && obj_player_one.y = obj_player_two.y){
if (reviveTimer >= 100){
obj_player_one.state = PLAYERSTATE.PLAYERPASSIVE;
obj_player_one.sprite_index = spr_idle;
reviveTimer = 0;
} else {
reviveTimer++;
}
}
}
This is supposed to work much like a revive system. The problem from this code is this line here,
if (obj_player_one.x = obj_player_two.x && obj_player_one.y = obj_player_two.y)
Is there any other way for me to check to see if both player one and two are at the same position or is there a syntax/logic error? Thanks!
if (obj_player_one.state = PLAYERSTATE.PLAYERDOWNED){
if (obj_player_one.x = obj_player_two.x && obj_player_one.y = obj_player_two.y){
if (reviveTimer >= 100){
obj_player_one.state = PLAYERSTATE.PLAYERPASSIVE;
obj_player_one.sprite_index = spr_idle;
reviveTimer = 0;
} else {
reviveTimer++;
}
}
}
This is supposed to work much like a revive system. The problem from this code is this line here,
if (obj_player_one.x = obj_player_two.x && obj_player_one.y = obj_player_two.y)
Is there any other way for me to check to see if both player one and two are at the same position or is there a syntax/logic error? Thanks!