Make scrolling background stop suddenly?
WolfieEnsalada
Member Posts: 26
Hey all, just have a quick question about how to do something in GS. (Don't we all? xD)
So, I have a scrolling background thanks to the help of Hachiko and several other helpful people on here, but now I have a bit of a dilemma. When my character crashes into an obstacle, I want there to be an on-screen message that allows you to tap the screen to retry. However, the only problem is that the background keeps scrolling, so you don't have time to react to the message and it floats away. xD Does anyone know how to make it so that the background halts suddenly when it's game over? Thanks! ^__^
So, I have a scrolling background thanks to the help of Hachiko and several other helpful people on here, but now I have a bit of a dilemma. When my character crashes into an obstacle, I want there to be an on-screen message that allows you to tap the screen to retry. However, the only problem is that the background keeps scrolling, so you don't have time to react to the message and it floats away. xD Does anyone know how to make it so that the background halts suddenly when it's game over? Thanks! ^__^
Comments
then when you set game.STOPBACKGROUND to 1, the background will stop until it becomes 0 again
// Red Dot Inc
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I have the movement thing set up so that it's a behavior on the background actor, just the Move behavior, and the background is scrollable. So it moves. I tried to set the attribute that way, and it didn't work, because the rule for the game to end and the retry link to come up is related to different actors, the obstacles and Blaze. So I can't make the background do anything using them. D= I'm probably not making any sense, though. -__-"
On your player, when they crash into an obstacle, put in the the behaviour:
Change attribute: Retry to 'true'
Ok - now you need to add a separate layer and make sure 'scrollable' isn't ticked.
In this layer, make a new actor called 'control'.
In this actor, have a rule that says:
If attribute 'retry' is true, then
spawn actor 'text that says retry'.
make sure collision is off in the this actor's physics.
On the text actor, have a rule that resets when touched any attributes you're using (such as 'retry', level, score, time, whatever) and is destroyed on touch.
That should do it I reckon.
Good luck with it,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Everything works fine, the only problem is, when the text for retry appears on the screen, when you click on it, nothing happens. And it has a rule on it that says that when touch is pressed, the actor should be destroyed and the game should be reset. o_o" So I have no idea why it isn't working. Am I supposed to add the actor to one of the layers? I didn't add it into the game per se, it just appears on-screen when the spawn thing kicks in on the control actor.
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
http://tinyurl.com/24a2ezo
I am not sure if this is what you want, it's just a screen cap. of the Actor Editor page for the retry text actor. o_o" You can see that I set it to reset the game when "touch" is "pressed," but when you actually click on it in Preview mode it doesn't seem to work.
IF attribute 'reset' is true
then
TIMER: after 1 second
Reset game
So, make a new boolean variable - call it 'reset'
Then, in your rule shown in your image, *before* the destroy actor rule have a 'change attribute' behaviour that says:
Change attribute 'reset' to true
Destroy actor
That should do it. Let us know how you get on.
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Great stuff - this community's at its best when helping people learn!
Best of luck on your game,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io