lock screen until end of rotation

BrynjeBamsenBrynjeBamsen Member Posts: 188
edited November -1 in Working with GS (Mac)
i have made a spinner that rotates a number of times when touch is pressed.
my problem is that i want to make the screen NOT to react to another touch until rotation is over.

how do i do that??

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    you could make a boolean gameAttribute called Busy...
    and on the spinner when touch is pressed changeAttribute game.Busy To: true
    when rotation is complete changeAttribute game.Busy To: false

    on your other touch actors in your Rule (All) when Touch is Pressed add the condition Attribute game.Busy is false..

    MH
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    thanks alot mate.... ill give that a go... seems like a good solution
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    hi again motherhoose. i think iam being a total noob here. but i cant get it to work...
    could be you a bit more specific. i was thinking if you could spawn an actor on top that you could NOT touch through or something and then destroy the actor according to spinstop?

    otherwise thank you great assistens :)
  • MotherHooseMotherHoose Member Posts: 2,456
    well...try what you think might work! ;D
    many ways to skin the cat...

    okay... you just want the SpinnerArrow to react to touch?

    on SpinnerArrow

    Rule (All) when
    Actor receives event | touch| is |pressed|
    Timer
    --For: (random(1,4) seconds √ Run to completion
    --Rotate clockwise
    Speed: 300

    you can choose the random function's (min,max) so spinner will not always stop in same place.
    the main thing is √ the Run to completion so the arrow will not react to another touch till the rotation is done.

    MH
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    hi motherhouse - What you are explaining above is the rotation itself which i got down perfectly. its the pause funktion i still cant figure out completely

    After the initial spin.( which works now ) You should not be able to touch anything until end og my interpolation Randome(0,360) spin.

    how do i achieve that? cant get your pause funktion to work :(
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    anyone?
  • MotherHooseMotherHoose Member Posts: 2,456
    ah... that is another game.Attribute boolean... you could name it BUSY

    rotating actor
    Rule
    when touch is pressed
    --changeAttribute and change the game.BUSY To: true
    --Timer stuff to do rotation
    -- Timer: After 4 seconds
    ----changeAttribute game.BUSY To: false

    and on your touchable actors enclose/nest your touching Rules in
    Rule when Attribute game.BUSY is false
    to the stuff...

    (you could make time exactly the random number for changing the BUSY...but, try this and see if you are getting what you want/need.)

    MH
Sign In or Register to comment.