Move in the facing direction (4 sides)

cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
edited February 2012 in Working with GS (Mac)
Hi guys,

Is this possible (and this will be my final question for a while).

You have an actor (say a square).

On the screen you have a controler with 4 buttons, each button represent a side of the square.

Button 1 - Top
Button 2 - Bottom
Button 3 - Left side
Button 4 - Right side

If you click on Button 1 - The actor moves up
If you click on Button 2 - The actor goes down
If you click on Button 3 - The actor goes left
If you click on Button 4 - The actor goes right

However, if the square turns upside down (for example, it colides with a wall that knocks it over and the top is now the bottom), if you press button 1 the actor still moves up.

Another way of looking at it would be, if each side of the square was a colour, and you have 4 buttons that represent each side, if you push one of the coloured buttons, it would move in the direction the colour is facing?

UGH, I hope I've explained this ok?

Cheers,

Chris

Comments

  • POMPOM Member Posts: 2,599
    edited February 2012
    I think all you should do is simply change its rotation , like this :

    If you click on Button 1 - The actor moves up , AND change rotation to 0
    If you click on Button 2 - The actor goes down , AND change rotation to 180
    If you click on Button 3 - The actor goes left , AND change rotation to 90
    If you click on Button 4 - The actor goes right , AND change rotation to 270

    "and this will be my final question for a while"
    Why? if you have question , ASK , don't be shy !

    Roy.
  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Are you only wanting to move UP, DOWN, LEFT, RIGHT, even if the actor is on say a 45degree angle (so the face which started at the top in a horizontal position, is now rotated to 45degree's)?
  • cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
    Hi guys,

    Thank you for your advice - I will give that a go and see what happens.

    I just feel that I'm asking LOADS of questions, and I don't really want to annoy anyone by flooding the forum with questions. Ultimately, what I'm trying to do is create a game with loads of mini games.

    After doing a little bit of a google, I've stumbled upon an already made game (also via GameSalad) that has exactly the same control that I would ideally like to achieve.

    The game is called Square Jump.

    http://itunes.apple.com/us/app/square-jump-lite/id435870419?mt=8

    It's a shame as I thought the idea was original, however, it would be great to still try and work out how its done.

    Thanks again guys, I do appreciate your help.

    Cheers,

    Chris

  • cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
    ps, it's worth saying that 'Square Jump' is quite a cool little game, quick to complete but definitely worthy of the full version, in addition, it's made by a fellow GS developer, so always willing to support.
Sign In or Register to comment.