how to make my character rotate

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

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
  • FajlajpFajlajp Member Posts: 666
    edited June 2013
    It's simple, pretty simple.
    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
Sign In or Register to comment.