generated from remarkablegames/renpy-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05038ff
commit 249ddb8
Showing
1 changed file
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
# https://www.fortunusgames.com/post/timed-choices-code | ||
transform alpha_dissolve: | ||
alpha 0.0 | ||
linear 0.5 alpha 1.0 | ||
on hide: | ||
linear 0.5 alpha 0 | ||
|
||
screen countdown: | ||
timer 0.01 repeat True action If(timer_time > 0, true=SetVariable('timer_time', timer_time - 0.01), false=[Hide('countdown'), Jump(timer_jump)]) | ||
### ^this code decreases variable time by 0.01 until time hits 0, at which point, the game jumps to label timer_jump (timer_jump is another variable that will be defined later) | ||
|
||
bar value timer_time range timer_range xalign 0.5 yalign 0.9 xmaximum 300 at alpha_dissolve | ||
# ^This is the timer bar. | ||
|
||
default timer_time = 0 | ||
default timer_range = 0 | ||
default timer_jump = 'start' | ||
|
||
label timer: | ||
screen countdown(timer_jump): | ||
timer 0.01: | ||
repeat True | ||
action If( | ||
timer_time > 0, | ||
true = SetVariable('timer_time', timer_time - 0.01), | ||
false=[ | ||
Hide('countdown'), | ||
Jump(timer_jump), | ||
] | ||
) | ||
|
||
bar value AnimatedValue(timer_time, timer_range): | ||
xalign 0.5 | ||
yalign 0.9 | ||
xmaximum 300 | ||
|
||
label menu1: | ||
label timer: | ||
|
||
$ timer_time = 3 | ||
$ timer_range = 3 | ||
$ timer_jump = 'menu1_slow' | ||
$ timer_time = 3 | ||
$ timer_range = 3 | ||
|
||
show screen countdown | ||
show screen countdown("timer_too_slow") | ||
|
||
menu: | ||
"End timer": | ||
hide screen countdown | ||
jump start | ||
menu: | ||
"End timer": | ||
hide screen countdown | ||
jump start | ||
|
||
label menu1_slow: | ||
label timer_too_slow: | ||
|
||
"Did you fall asleep, by any chance?" | ||
"Did you fall asleep, by any chance?" | ||
|
||
jump start | ||
jump start |