iphone touch control

markh72markh72 Member Posts: 23
edited November -1 in Working with GS (Mac)
Hello

Really hope someone can help me on here
Im trying to make a shoot-em style game, where you drag the crosshair round the iphone screen with your finger, but it also has a trigger button sitting in the bottom of the screen (left/right side) how can i stop when the trigger is touched, the crosshair doesnt hover over or under it, need it to stay on the actor ?? also when im using collide or overlay, it just seems to collide, the crosshair doesnt hover over the actors ?

any tips greatly appreciated

mark

Comments

  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    If you want 2 actors to occupy the same space you need to remove the collide behavior. You can still test for collision/overlap in your rules, but you don't want them to bounce off of each other.

    As for having the pression of the fire button stop the crosshair's movement. Create a game integer attribute called `stopcrosshair` or something.

    Then do the following in the fire button:

    `
    Rule: when touch is pressed
    --change game.stopcrosshair to (game.stopcrosshair+1)%2
    otherwise
    --Rule: when touch is released
    ------change game.stopcrosshair to (game.stopcrosshair+1)%2
    `
    In the crosshair actor do something like this:

    `
    Rule: game.stopcrosshair = 1
    --change self.Physics.Movable to false
    Otherwise:
    --change self.Physics.Movable to true
    `
    Just so you know, none of that was tested as I am at work on a PC...but it should work. ;-)
Sign In or Register to comment.