T
TimTim
Guest
Hi guys, Im trying to use the "==" to say if an object travelling across the screen hits or crosses the x position of another object, do something. It does not do anything. Im making a pong-based game and trying to say if the ball passes the opponent's line (player is fixed on the y axis so his x axis remains the same), something happens.
in the step event of obj_fire:
if obj_fire.x == obj_player2.x
{
global.player2hp -= 3
}
Everything is spelled correctly and there are no errors that come up. It just simply doesnt do anything. I tried this using ">=" and that actually changed the score (global.player2hp). The "==" does not.
Any help here would be appreciated.
in the step event of obj_fire:
if obj_fire.x == obj_player2.x
{
global.player2hp -= 3
}
Everything is spelled correctly and there are no errors that come up. It just simply doesnt do anything. I tried this using ">=" and that actually changed the score (global.player2hp). The "==" does not.
Any help here would be appreciated.