Stopping at the right time minigame (Solved)
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Stopping at the right time minigame (Solved)
Hey kind people,
I was thinking of making a short minigame: Imagine a 20sec timer with millisecs to that infinitely goes in loop from 0.00 to 10.00 and the player wins if he clicks between 07.50 and 09.50. (Yes, it will be an easy minigame).
I'd prefer if I didn't use screens.
Thank you in advance.
I was thinking of making a short minigame: Imagine a 20sec timer with millisecs to that infinitely goes in loop from 0.00 to 10.00 and the player wins if he clicks between 07.50 and 09.50. (Yes, it will be an easy minigame).
I'd prefer if I didn't use screens.
Thank you in advance.
Last edited by morrris on Sun Sep 18, 2022 9:08 am, edited 1 time in total.
- enaielei
- Regular
- Posts: 114
- Joined: Fri Sep 17, 2021 2:09 am
- Tumblr: enaielei
- Deviantart: enaielei
- Github: enaielei
- Skype: enaielei
- Soundcloud: enaielei
- itch: enaielei
- Discord: enaielei#7487
- Contact:
Re: Stopping at the right time minigame
Code: Select all
screen test(time=10.0):
default ctime = 0.0
default interval = 0.5
timer interval repeat True action SetScreenVariable("ctime", min(ctime + interval, time))
button:
action Return(ctime)
xfill True
yfill True
text "[ctime]"
if ctime == time:
timer 0.01 action Return(ctime)
label start:
call screen test()
if _return >= 7.50 and _return <= 9.50:
"Passed"
else:
"Failed"
Last edited by enaielei on Sun Sep 18, 2022 5:36 am, edited 1 time in total.
Re: Stopping at the right time minigame
18 minutes? What took you so long? lol
Incredible! Let me try something else: I want a million bucks!
Thank you so much!
Incredible! Let me try something else: I want a million bucks!
Thank you so much!
Re: Stopping at the right time minigame
#enaielei
Unfortunately the timer is stuck at 0.0 but I'll try to fix it too. Thanx again.
Unfortunately the timer is stuck at 0.0 but I'll try to fix it too. Thanx again.
- enaielei
- Regular
- Posts: 114
- Joined: Fri Sep 17, 2021 2:09 am
- Tumblr: enaielei
- Deviantart: enaielei
- Github: enaielei
- Skype: enaielei
- Soundcloud: enaielei
- itch: enaielei
- Discord: enaielei#7487
- Contact:
Re: Stopping at the right time minigame
I never really bothered testing the code, sorry for that.
I had one mistake here.
It should be...
time not ctime.
I had one mistake here.
Code: Select all
timer interval repeat True action SetScreenVariable("ctime", min(ctime + interval, ctime))
Code: Select all
timer interval repeat True action SetScreenVariable("ctime", min(ctime + interval, time))
Re: Stopping at the right time minigame
It's perfect! Thx again.
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot]