This is a QTE minigame where the player clicks the targets (which are imagebuttons) and everytime they click, the button adds a point and randomizes a new location. Is there any way to make it so that after each click, the imagebutton plays a small/short animation (for example the target exploding) before it disappears and goes to a new location?
Code: Select all
screen target_scr(tgt_align, t):
# animated timer
bar value AnimatedValue(0, t, t, t) bar_invert True xsize 300 align (0.95, 0.05)
imagebutton:
auto "target_%s.png"
action [Hide("target_scr"), Return(1)] # hide the screen by its name
align tgt_align
sensitive not game_over # clickable if game is not over
if not game_over:
timer t action [Jump("too_slow")]
label minigame(targets_number, game_time):
label try_again: # place to jump to for a game replay
pass
$ targets_left = targets_number # set the game length
show qte scoreboard
show screen minigame_scr
while targets_left > 0: # show targets while we have them
show screen target_scr(tgt_align=( renpy.random.randint(2, 8)*0.1, renpy.random.randint(2, 8)*0.1 ), t=game_time)
$ ui.interact() # waits for player interaction
$ score += 1
$ targets_left -= 1