how to make my character rotate
eggcelent
Member Posts: 11
I recently watched some rotate videos but none of them helped I want my character to change gravitey and when it changes gravitey to flipe the character can anyone help
Comments
http://www.deepblueapps.com/ninja-jump-template/
Need Help? Email Me | Templates | Full Game Source Code
I assume you make it for iPhone/iPad and want to touch somewhere in the scene.
You will need a game.attribute, call it gravity(integer)
Create a new actor and put it on the whole scene(change opacity to 0)
-When touch is pressed
Change attribute game. to (game.gravity+1)%2 (This will have the attribute to switch between values 0 & 1)
And then go in to the game character actor.
-if attribute game.gravity = 0
Accelerate down
-otherwise
Accelerate up
Now you have the change gravity done. Now to the rotation
In the game character actor to in the same rule as the accelerate
-If attribute game.gravity=0
Change attribute self.rotation to 0
Change attribute self.graphics.flip horizontally to false
-Otherwise
Change attribute self.rotation to 0
Change attribute self.graphics.flip horizontally to false
Here is a quick demo I made (using art from the amazing @jamie_c)
https://www.dropbox.com/s/6l44h0qvh8fmmon/Untitled.zip
//Fajlajp