Click anywhere to...

jeffheif1jeffheif1 Member Posts: 10
edited November -1 in Working with GS (Mac)
My game contains one character who can move in only one direction. I currently have it so "when pressed" he moves forward. The only problem is that when I tested it on the iphone, the character was too small to accurately press him each time. Is there any way to make it so if you touch anywhere on the screen, the character will move forwards? I was thinking about making a clear actor over the whole screen, only to find out that there's not way to say "if clear actor receives touch, then move character", and then I was also thinking about making a clear character make a "moving credit" attribute set to 1, and then when the credit is 1, the character moves and the attribute is set to zero. The only problem I found is that when a lot of attributes are being used, the gameplay slows and it causes a much higher rate of glitches. if anyone has any solution to my problem or could help me brainstorm, that would be a huge help. Thanks!
jeffheif1

Comments

  • VoidedSkyVoidedSky Member Posts: 1,095
    when mouse button is down
  • design219design219 Member Posts: 2,273
    CowTechMan is correct, just use the condition "when mouse down" ... execute your move behavior.

    If you wanted to just have to touch the actor, you would use "touch" ...or add "mouse is inside" to the "mouse down".

    _______________

    Nesen Probe http://itunes.apple.com/us/app/nesen-probe/id377766693?mt=8
    Tickle Stones http://itunes.apple.com/us/app/tickle-stones/id363484260?mt=8
    Food Fight! (free) http://itunes.apple.com/us/app/food-fight/id352646643?mt=8
  • jeffheif1jeffheif1 Member Posts: 10
    Will the "mouse button" work the same as touching the screen on an iphone/ipod/ipad? so you can TOUCH it anywhere? or will it only work on the computer?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    it will work on the phone. For future games it would help a lot to understand how to use game attributes. Create a boolean attribute called move.

    In an invisible actor create a rule that says

    When touch is pressed
    change game.move to true (true is the same as 1)
    Otherwise
    change game.move to false (false is the same as 0)

    Then in the moving actor have a rule that says

    When game.move is true
    Move

    Now the invisible actor is communicating indirectly with the moving actor. This is really helpful for creating d-pads, joysticks, fire buttons, etc.
Sign In or Register to comment.