我有一个小脚本,当我按下某个键时会更改精灵索引。
if (key_right)
{
sprite_index = playerRightSpr;//<-------------
image_speed = 1; //|
} //|
if (key_left) //|
{ //|
sprite_index = playerLeftSpr; //|
image_speed = 1; //|
} //|
if (key_left) && (key_right) //|
{ //|
sprite_index = playerSpr; //|
image_speed = 0; //|
} //|
if (!key_right or key_left) //add this and this, doesn't work
{ //but it does when I remove this code.
sprite_index = playerSpr;
image_speed = 0;
}
有没有另一种说法,当站着不动时让精灵 playerSpr 因为我尝试的方式似乎会导致冲突。在此先感谢博迪