Probably a Simple Question...

I created a game level that has one main actor that you guide to a goal avoiding bad guys. I put in a health bar following QuantumSheep's tutorial and it works well.
So basically when my actor hits a bad guy he loses energy from the bar. Or when my actor hits a 'dead zone' he dies. – Either way the scene then changes to a 'death screen' that has a button on it to return to a 'start again' screen. You then click 'Start Again' to go to Level 1.
My problem is that the health bar is still at 'zero' and so the level is then unplayable until I reset it manually. I have tried loads of different things including creating an attribute to change the "game.Energy" to "game.Energy=10" on click of the 'Start Again' button but so far nothing seems to work.
I spent a long time trying to get 'Reset Level" to work but looks like I'm beating a dead dog with that.
I'm pretty sure I'm missing something obvious here but hopefully somebody can help or point me to a tutorial for resetting game values, thanks.
T
So basically when my actor hits a bad guy he loses energy from the bar. Or when my actor hits a 'dead zone' he dies. – Either way the scene then changes to a 'death screen' that has a button on it to return to a 'start again' screen. You then click 'Start Again' to go to Level 1.
My problem is that the health bar is still at 'zero' and so the level is then unplayable until I reset it manually. I have tried loads of different things including creating an attribute to change the "game.Energy" to "game.Energy=10" on click of the 'Start Again' button but so far nothing seems to work.
I spent a long time trying to get 'Reset Level" to work but looks like I'm beating a dead dog with that.
I'm pretty sure I'm missing something obvious here but hopefully somebody can help or point me to a tutorial for resetting game values, thanks.
T
Comments
There are far better people at this than me these days, perhaps they'll be able to help.
Oh, and as an aside, nice tagging of the topics - better luck with the thread title next time
Good luck,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I posted a query before and got no reply at all so I thought I'd try a different approach
Cheers,
T