Dragging with Clickable Background

architectpianistarchitectpianist Member Posts: 21
edited November -1 in Working with GS (Mac)
Hi,
I have an iPad game where you tap the screen to spawn a random pentomino, then you can drag to reposition the pentomino. The problem I'm having is that when you tap the screen to drag, another pentomino is unnecessarily spawned. How can I make an exception for when the user taps on a pentomino?
Thanks,
architectpianist

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    A couple of solutions (neither perfect)

    1) In the background have a rule that says

    when game.allowSpawn is true
    ---when touch is pressed
    -----timer, after 0.1 seconds (do NOT check run to completion)
    --------spawn actor

    In the actor have a rule that says when touch is pressed change game.allowspawn to false

    When touch is released change game.allowspawn to true

    then put your dragging rules after that one.

    2) In the background

    When touch is pressed
    ---when touch count > 1
    -----spawn

    In your instructions tell people that a two finger touch spawns and a one finger touch can be used for dragging.

    I would try to get the first option working.
Sign In or Register to comment.