countdown timer

countdown timer

countdowntimer

Details

Kode wheel segment Timing and Logic
Style Specialised
Modifiers hold time / in frames / loop
Primarily WHEN/DO WHEN
Pre-made brains that use it unknown

Timing and Logic > countdown timer

Description

This tile prevents the DO side of the line it is on, and any child lines, from working until the time stated is up.

Like this:

WHEN countdown 10 DO fire rocket

Paired with a number it will count seconds. With no number it will default to one second. You can also use a frame modifier to count in frames instead of  seconds (1/30 of a second).

Example Code

WHEN [countdown timer][3] DO [destroy]

 

Modifiers

hold time: 

  1. Used with a countdown timer with a time.
    WHEN [countdown timer][4][hold time][3] DO [move]
    This will execute the DO side after 4 seconds for a duration of 3 seconds – it is the same as doing this:
    WHEN [countdown timer][4]
    …WHEN [duration][3] DO [move]
  2. Used with a countdown timer and a loop tile.
    WHEN [countdown timer][4][loop][hold time][3] DO [move]
    This will execute the DO side after 4 seconds, player will move for 3, then pause for 4, then move for 3 etc…

in frames: Instead of seconds if you use this tile it will count frames
WHEN [countdown timer][3][in frames] DO [kill]

loop: This will loop the line so that it runs continuously
WHEN [countdown timer][5][loop] DO [jump]
The character will jump every 5 seconds

Outputs

 

timer seconds remaining : This shows how many seconds of the timer is left to go. You use it in a child line to the timer with an [else] tile. You can use it to set a number variable.
WHEN [countdown timer][5] DO
…WHEN [else] DO [display][timer seconds remaining][screen top right]

timer seconds complete: This shows how many seconds of the timer has passed. You use it in a child line to the timer with an else tile. You can use it to set a number variable.
WHEN [countdown timer][5] DO
…WHEN [else] DO [display][timer seconds complete][screen top right]

timer ratio remaining: Use the same as above. This number represents a number between 0 and 1 that represents the percentage of the time remaining.
timer ratio complete: Use the same as above. This number represents a number between 0 and 1 that represents the percentage of the time completed.

 

Other Uses

Comments are closed.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: