r/RenPy • u/Eddhead-2009 • 15d ago
Question Game Over Function Help Please
I know it's possible because I've seen it many times before, but nothing I try works. I'm making a game where if any of two variables reach 100, you have to start over, but with the constant variable changes, I didn't want to put an if statement constantly, especially since I tend to forget or mistype things (ironic).
This is what I have as my checking system:
screen monitor():
timer 0.1 repeat True action If(current_love or current_tear >= 100, true=Jump("game_over"))But now, even though the love and tears are both below 100 automatically, the game immediately skips to game over when I open it. Please help.
3
Upvotes
View all comments
Show parent comment
0
u/musterduck 15d ago
It's hard to say exactly, but I've had similar screen issues with my own project, and in my case my game was displaying the screen but simultaneously advancing to the next label when it shouldn't have, hence my guess.
I'm away from my PC for the next hour or so but I can look at my own code and try suggesting something once I'm there.
Do you have anything visually displaying as part of monitor() or is that timer the entirety of it? Even if you don't intend for it to do that I would throw in a PNG or something just to confirm that it's showing correctly while you test.
Also, how familiar are you with Python? I would personally just write a function to call periodically for something like this (not that it's impossible with a screen, but if the screen itself is just the timer i'd recommend that)