Turning card effect?
Posted 18 April 2012 - 07:07 PM
Posted 18 April 2012 - 07:22 PM
front=spr_card_01 //u can leave this out and change in step same value
Posted 18 April 2012 - 07:37 PM
image_speed = 0 //Stops your sprite from scrolling through subimages automatically time = 0
In the Step event:
image_xscale = cos(degtorad(time)) //In case you don't know, the cosine function returns a number from -1 to 1. Look it up for more info, it's very very useful- //Resets the counter so that it doesn't get to very high numbers if time >= 360 time -= 360 else time += 2 //Change this number for different turning speeds. Make it negative for it to go the other way. //Changes the sprite's subimage so it will show the two "faces" of the card if image_xscale < 0 image_index = 1 else image_index = 0
This code will make the card turn forever, but I hope from here you can take over and adapt it to your needs.
Edited by PetzI, 18 April 2012 - 07:39 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users