Help with making actors visible/invisible and updating timer?

hayleyd11hayleyd11 Member Posts: 6
edited January 2014 in Working with GS (Mac)
Hi, so I'm not sure whether it's even possible to do this, but what I would like to know is:
I have an actor that has to go around a maze collecting apples. The player has 60 seconds to collect them all and reach the exit. I've got to this stage but now I would like to add an additional feature to the game.

I want to create an actor called golden apple, and then make this golden apple appear and disappear randomly in the game, for a period of 3 seconds. When this golden apple appears, the player can then shake the phone, and when the accelerometer identifies that the phone has been shook, it adds 20 seconds to the time left in the game. I only want the time to increase if the player shakes the phone only when the golden apple is visible (for that 3 second period).

Is this possible to do? I'm new to this so not quite sure where to start.

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    It's certainly possible though you will need to look into accelerometer controls to get the shake setup right. As far as your actor visibility you just adjust your alpha attribute from 1 to 0 and then move your apple around. Only have the shake detection work while the actors alpha is 1

    Depending on how new you are this may be a hit over your head as a whole. If that doesn't make much sense I would suggest studying all of the gshelper and GS cookbook videos

    Cheers
  • hayleyd11hayleyd11 Member Posts: 6
    Thank you very much that makes sense! I reckon I'll be able to figure it out from what you've said, I was just wondering how I'd get it to know when the player has shook the phone when it's visible, so using the alpha makes a lot of sense. Thanks again for the help.
Sign In or Register to comment.