Help with touching detection.

Hi guys. I need help with my pong game... The problem is that when i try to play in my device the touching looks really bad, i can't move the actor when i need... looks that the actor have some delay or the touching sensitive is bad too but i did one rule for the touching and another for the serving.. The touching rule i used have the game.Mouse.Position.Y > 60 and < 260 and one constrain att self.position.y to game.mouse.position.y and the serving i think is working good... Please, anyone help me. Thanks.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    That should work. You can simplify things a little:

    When Touch is Pressed
    .....Constrain Attribute self.position.Y to max(60,min(260,game.mouse.Position.Y))

    How large is your paddle actor? If it's skinny, the touch sensitivity may not work so well. You can increase the width or you can mask it by including extra transparent space on the artboard around the paddle when you export it from a drawing program.

    Are you making sure to only contact the screen in one place with one finger? If that's a problem, you should change the game.mouse.Position.Y to game.Touches.Touch 1.Y.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mmmodelmmmodel Member Posts: 46
    Thanksss you saved my day, works perfect, thanks again :D
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're welcome!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.