Change Attributes after Time
Greetings GS forum!
How can I make it so that:
-On Touch
-Attribute Spawn Rate Decreases
-Attribute Add Score Increases
-After 5 Seconds
-Attribute Spawn Rate changes back to before Touch
-Attribute Add Score changes back to before Touch
I can't seem to get the attributes to return to their normal stages.
On that note can I set a timer to 'Every Attribute.Spawnrate' as opposed to 'Every 5 Seconds'?
Thanks
-Blackmill
How can I make it so that:
-On Touch
-Attribute Spawn Rate Decreases
-Attribute Add Score Increases
-After 5 Seconds
-Attribute Spawn Rate changes back to before Touch
-Attribute Add Score changes back to before Touch
I can't seem to get the attributes to return to their normal stages.
On that note can I set a timer to 'Every Attribute.Spawnrate' as opposed to 'Every 5 Seconds'?
Thanks
-Blackmill
Best Answer
-
gyroscope I am here.Posts: 6,598
OK, understood, so if you want it on for 5 seconds, that means the user can touch it repeatedly within that time, each time getting 2 points? If so, my suggestion above will work but making the touch rule When touch is released. Hope that solves it for you.""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
Any fixes?
-Blackmill
Hi @Blackmill
A way is needed to interrupt the Timer and reset it. So basically you have to make sure that Run to Completion is not checked in the Timer, then use a boolean "switch" (I'm not sure how you're triggering the change of the SpawnRate attribute, so the following assumes it's on Touch):
Rule:
When game.interrupt is false
Timer: Every game.spawnrate
Spawn Actor
x and y pos. random(?,?)
Rule:
When Touch is pressed
Change Attribute game.interrupt to true
Change Attribute game.SpawnRate to Random(1,5)
Change Attribute game.interrupt to false
That should work, I think; hope it helps out.
----------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I was unaware that it would be an issue. You suggested a reason as to what my issue was but gave no relevant solution. Therefore it was not the answer I was requiring so I rejected your post.
Usually, I find that if you tag your thread as Answered, when it truly isn't, there is no more debate on the matter and I feel that this matter is unfinished.
Sorry for the inconvenience :S I'm new to this...
Blackmill
I think it's probably best to avoid the Reject, Blackmill ;-) @tenrdrmer was answering part of one of your questions and so was just trying to be helpful as you know; rejecting can only cause upset.... don't know why it's there really... unless an answer is spam-like or something, only then should it be used, I reckon....
Anyhow, I hope i've answered part of one of your questions in my post above.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'll give it a whirl.
-Blackmill
So, on Touch it changes my Boolean Attribute to True. Attribute Game.SpawnRate increases as does the Attribute Game.IncreaseScore.
But I can't seem to get it to turn to false after 5 seconds.
Your thoughts?
-Blackmill
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-For 5 Seconds
-Set Boolean Switch to True
I then state that when:
-When Switch is True
-When Game.SpawnRate is greater than or equal to 0.5
-Game.SpawnRate changes to Game.SpawnRate - 0.1
-Game.AddScore changes to 2
That's it... but it won't do it. The attributes never change back.
The timer is unchecked.
I'm a little unsure exactly how your Rules are working in practice without "seeing them in action" but a couple of things that might be relevant and help out:
Your Timer, it'd be better to put:
Change attribute boolean switch to true
Timer: after 5 seconds
Change attribute boolean switch to false
But even then, I'm not sure why you need a timer at all: if...
-Game.SpawnRate changes to Game.SpawnRate - 0.1
-Game.AddScore changes to 2
...are both single, one-off events, why use a timer at all? (Confused of Kent ;-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Basically, it's a game where blocks fall from the top of the iPhone. You click on a particular type of block which is indicated.
However, during the game a random gold block falls down. On touch, it will increase all the spawn rates, increasing difficulty, but also rewarding the player with 2 points instead of 1. It isn't meant to stay on forever, only 5 seconds.
That's why there needs to be a timer.
-Blackmill