Best option for checkpoint/trigger events in non-linear gameplay?
SingleSparq
Member Posts: 1,339
Looking for suggestions on reaching goals in a level, triggering check points (that you can restart from) and triggering events to happen In game that follows no linear path (takes place in space so you move in all directions).
I thought of using game.timer in cases as 'if game.timer=50 then release bad guys' etc. but if you die and go back to check point can you reset timer or put it back to that time point?
Is there something I can do with tables to assist in this? Like a check list when goals are completed and such.
Any thoughts appreciated.
I thought of using game.timer in cases as 'if game.timer=50 then release bad guys' etc. but if you die and go back to check point can you reset timer or put it back to that time point?
Is there something I can do with tables to assist in this? Like a check list when goals are completed and such.
Any thoughts appreciated.
Comments
I have some sort of timer that will trigger events. For example, in my Air Supply games the time will be distance, as that goes up all the time while you're running.
So, when distance = 3000, trigger UFO.
Then I will probably add a self.timer to the UFO.
Once distance = 3000 trigger UFO. Trigger self timer to start.
When self timer = 2000, trigger UFO again.
If UFO is destroyed, goes off-screen, then set UFO self timer to 0.
Essentially what happens is you trigger the UFO first when distance = 3000
The UFOs timer will make it come back every 2000 clicks of its timer.
I like to vary it a little too, by making the trigger variable (but not by much).
e.g. when distance = random(2800,3200) then trigger UFO.
This makes stuff less predictable.
Hope some of that makes sense!
QS =
D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io