reset scene problem
jstrahan
Member Posts: 498
ive got an attribute to track how long u go with out tapping screen and if its more than 20 seconds its to reset game
ive tried reset game and change scene but once it hits 20 seconds nothing happens and the game locks up
ive tried reset game and change scene but once it hits 20 seconds nothing happens and the game locks up
Comments
When the game starts it plays an animation until u tap on the screen then it changes to the menu scene and I'm trying to get it to go back to the init scene after 20 seconds without pressing a menu option
Everything works fine it counts the 20 seconds checks for any touches resets countdown if there is a touch and only performs this on the menu screen if you select options from the menu it changes the menu to the options and stops countdown and resets countdown when you go back to the menu but once the countdown reaches 20 seconds it locks up
I'll try to get a video showing problem
when it reaches 21 seconds it changes the reset game attribute to 1 which activates rule to reset game action
sorry theres no sound cant get mic to work when i plug it in or unplug it it shows on the mic meter but nothing while its pluged in
Have a time count up to 20 on your main menu.
When it reaches 20, have an attribute called 'startagain' - it should be a boolean.
On your main menu, have a rule somewhere that says 'When startagain = true' go to scene 'init'.
On your init screen, have a rule somewhere that says 'change attribute startagain to false'
Hopefully that'll work - let us know how you get on!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
attributes involved:
menu display 0 = menu shown in video
start time real #
check time real #
reset game switch to reset game
first rule
if menu display=0
set start time = game.time
constrain check time = game.time-start time
second rule
if touch pressed reset start time = game.time this reset the countdown if u touch screen
third rule
if game reset = 1 ive tried (reset game action and change scene action)
fourth rule
if check time>20 set game reset to 1
don't use constrain check time = game.time-start time
you should use
if game.time>(start time+20) set game reset to 1
have invisible actor over screen with
only three rules and three attributes
scene attributes:
start time real #
reset game Boolean
menu display int
first rule
if menu display=0 or actor pressed
change start time to game.time
this resets countdown if screen is touched or when menu shown in video is displayed
second rule
if reset game = true
ive tried
(reset game action)
(change scene to init scene)
(change scene to quit scene)
third rule
if game.time>start time+20
change reset game to true
still game counts to 20 changes reset game to true and locks up