Left/Right touch screen controls with a scrolling background

GugsGamesGugsGames Member Posts: 54
edited November -1 in Working with GS (Mac)
I'm trying to implement a simple control system for my platformer. iPhone is in landscape mode. If you touch the right half of the screen, your character moves right. If you touch the left half of the screen, your character moves left. Simple. I may or may not have visible buttons, I have not decided. I can get this working well when the Scene is the size of the iPhone screen, as I just create two actors (one panel on the left side and one on the right) for the player to touch to move.

However, when I have a Scene that is larger than the iPhone screen as exampled in the Platformer Template, I don't know how to make the same controls work for that. I place the actors down in the boundary highlighted as the iPhone but I need some logic to link that with the larger area. Any tips?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    hey there

    click the scene tab and go into the layers. make a new layer put it at the top and uncheck scrollable, then put your buttons on that layer

    cheers
  • GugsGamesGugsGames Member Posts: 54
    Heya, thanks, I'll give that a try!!!
  • GugsGamesGugsGames Member Posts: 54
    Tried it and it works perfectly. Thanks again.
  • GugsGamesGugsGames Member Posts: 54
    Thanks Basseman, I tried that method too. Both work well. Yours is good to know as I don't need to have physical buttons for it, the only problem is, can I apply this to 'Touch' instead of mouse presses?
  • GamersRejoiceGamersRejoice Member Posts: 817
    mouse press will work just like touch also.
  • GugsGamesGugsGames Member Posts: 54
    Even if I test it on an iPhone/iPod?
  • GamersRejoiceGamersRejoice Member Posts: 817
    yes sir! :)
  • GugsGamesGugsGames Member Posts: 54
    Great, that's pretty awesome!
Sign In or Register to comment.