Login | Register

How to Save Space and Load Time by Mirroring Sprites

January 28, 2009, 09:16 by Nano
[loading]
-->




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.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games