FlatulenzaFiamm
Member
Heeyy, today I found something very weird.
So I was testing out the "sprite_index" expression, event, whatever it is, and made this
very simple code in order to change the sprite:
if !hsp_x = 0
{
sprite_index = camm
}
So, basically, if the variable hsp_x is NOT 0, then it will do the sprite_index thingy.
The hsp_x in my project can ONLY be 6, 0 or -6.
When it's 0, of course, the code won't work; when it's 6, of course, it works, but if it's -6 it does not work for some reasons.
The weird thing is that, later, I re-wrote the thing as:
if hsp_x < 0
{
sprite_index = camm
}
if hsp_x > 0
{
sprite_index = camm
}
And now it worked as intended, even tho the logic applied is the same.
Am I doing something wrong or is GameMaker that has some funny idea of what the number -6 actually means?
Thanks comrades!
So I was testing out the "sprite_index" expression, event, whatever it is, and made this
very simple code in order to change the sprite:
if !hsp_x = 0
{
sprite_index = camm
}
So, basically, if the variable hsp_x is NOT 0, then it will do the sprite_index thingy.
The hsp_x in my project can ONLY be 6, 0 or -6.
When it's 0, of course, the code won't work; when it's 6, of course, it works, but if it's -6 it does not work for some reasons.
The weird thing is that, later, I re-wrote the thing as:
if hsp_x < 0
{
sprite_index = camm
}
if hsp_x > 0
{
sprite_index = camm
}
And now it worked as intended, even tho the logic applied is the same.
Am I doing something wrong or is GameMaker that has some funny idea of what the number -6 actually means?
Thanks comrades!