Touch Controls iPhone - Help Please

JoshKahaneJoshKahane Member Posts: 470
edited November -1 in Working with GS (Mac)
Hi

So I am looking to buy the Express version soon so I can get testing on my iPod Touch but for now I wanted to check something with you, as if this was wrong I wouldn't really know what to do.

In my game I have a ball, and I want it so that when I touch to the left of the ball, it moves left, touch to the right it moves right and same with up and down. Here is what I have done with my Move Right rule:

'Attribute' 'game.Touches.Touch 1.Y' '>' 'self.Posotion.Y'

Accelerate
'Direction: 0' 'Relative to: Actor'
'Acceleration: 100'

Hope that makes sense, just copied what I entered in my rule. Hope you can help, but I heard that testing on the computer is the same it just replaces touch with the mouse but it isn't working if that the case, so any help much appreciated, thanks.

Comments

  • CobraCobra Member Posts: 160
    For detecting touches to the right of an object you'd need X, not Y.
  • JoshKahaneJoshKahane Member Posts: 470
    Woops, hehe. Would I need to change both 'Y's to 'X'? Or a certain one?
  • JoshKahaneJoshKahane Member Posts: 470
    Oh, on a side note, is it possible to make portrait games?
  • maniraptormaniraptor Member Posts: 81
    Yes, you would need to change both of those "Y"s in your example code to "X". So it would look like:

    'Attribute' 'game.Touches.Touch 1.X '>' 'self.Position.X'

    The reason is movement left and right happens on the X axis. Movement up and down happens on the Y axis.
Sign In or Register to comment.