How to Save Space and Load Time by Mirroring Sprites
January 28, 2009, 09:16 by Nano
-->
Just put in this movement script in the step event of the object and the sprite will automaticaly mirror itself depending on which direction it is moving.
if keyboard_check_pressed(vk_left)
{
motion_set(180,4);
image_xscale=-1;
}
if keyboard_check_pressed(vk_right){
motion_set(0,4);
image_xscale=1
}
if keyboard_check_released(vk_left)
{
motion_set(0,0);
}
if keyboard_check_released(vk_right)
{
motion_set(0,0);
}
P.S.
Thanks death-droid.
.
Users logged in:
SekSpeelayjap
SekSpeelayjap
Comments
Loading comments...