Touches

AlexGreeneAppsAlexGreeneApps Member Posts: 16
edited November -1 in Working with GS (Mac)
I am new at Gamesalad so let me say that first...

In the game I am creating, I want there to be the main character at the bottom of the screen and the user can drag the character side to side (only side to side) to catch falling objects. How would I go about doing this?

Thanks :)

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    when your character is touched constrain the x coordinates and also set up limits for x coordinates to if x (or mouse position x)is less than or equal to 20 constrain x to 20 same for the right limit... Just off the top of my head, but this should work... Good Luck!
  • AlexGreeneAppsAlexGreeneApps Member Posts: 16
    Could you clarify?

    I add rule and In that rule I add a constrain attributes behavior that constrains Game.Mouse.position.X to 100 for example. what do i do from there, if what i did was even correct... thanks :)
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Yea, sorry...

    (This will only work if you only have one touch... If your using multitouch you'll need to use touch 1, touch 2 etc.)

    When touch is pressed constrain self.position.x to game.mouse.position.x

    Then you'll need limits for your left and right walls...

    If mouse.position.x < or equal to 20 constrain self.position.x to 20... And then do the same thing on your right wall.... (Just an example)

    This should work, but I'm not on a computer right now so I cant test it... Good Luck! :D
  • AlexGreeneAppsAlexGreeneApps Member Posts: 16
    Thanks so much! One last Q: What behavior do I use to declare "If mouse.position.x < or equal to 20 constrain self.position.x to 20" ? is it a rule or something else?
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Yep, create a rule... change it to attribute.. then go to the drop down menu... Then go to devices then mouse position x.... Then change it to less then or equal to and then enter 20.. Thats it for your rule.. Then enter the constrain underneath :D Good Luck!
Sign In or Register to comment.