I am making a minigame, not related to Mario; and I have a problem, the point of the game is you're a laser and you change to the corresponding color of the enemy. The problem I'm having is: one color of the enemy still hurts you, even when you're the same color as it. I'm not sure where the coding error is so I would like someone to look over my script, I myself have looked over it numerous times and have narrowed it down to the following code but can't be sure, I tried changing a few things but no difference.
Code:
// Death
if (place_meeting(x,y,player) && player.image_index = 0 && blue = 0)
{
instance_destroy();
}
if (place_meeting(x,y,player) && player.image_index = 1 && blue = 1)
{
instance_destroy();
}
if (global.hits > 0 && place_meeting(x,y,player) && player.image_index = 0 && blue = 1)
{
global.hits -= 1;
instance_destroy();
}
if (global.hits > 0 && place_meeting(x,y,player) && player.image_index = 1 && blue = 0)
{
global.hits -= 1;
instance_destroy();
}
I've also included the .gmk in case anyone could look?
http://www.mediafire.com/?mxsz4atkdd03bb5
I am making a minigame, not related to Mario; and I have a problem, the point of the game is you're a laser and you change to the corresponding color of the enemy. The problem I'm having is: one color of the enemy still hurts you, even when you're the same color as it. I'm not sure where the coding error is so I would like someone to look over my script, I myself have looked over it numerous times and have narrowed it down to the following code but can't be sure, I tried changing a few things but no difference.
[code]
// Death
if (place_meeting(x,y,player) && player.image_index = 0 && blue = 0)
{
instance_destroy();
}
if (place_meeting(x,y,player) && player.image_index = 1 && blue = 1)
{
instance_destroy();
}
if (global.hits > 0 && place_meeting(x,y,player) && player.image_index = 0 && blue = 1)
{
global.hits -= 1;
instance_destroy();
}
if (global.hits > 0 && place_meeting(x,y,player) && player.image_index = 1 && blue = 0)
{
global.hits -= 1;
instance_destroy();
}
[/code]
I've also included the .gmk in case anyone could look?
http://www.mediafire.com/?mxsz4atkdd03bb5