Skip to content
BADIM-PC\Vadim edited this page Mar 22, 2017 · 11 revisions

time

time -> ticks elapsed from game start

Output:

  • ticks : return the numbers of milliseconds elapsed from the beginning of the application.

Description:

The function return elapsed time from the start of the cartridge expressed in milliseconds. Useful to take track of the time, animate items and rise events.

Example

-- time demo

function TIC()
 cls()
 --Show rising time
 print('Seconds elapsed: '..time()/1000)  
 
 --Blink warning
 if(time()%500>250) then
  print('Warning!',0,30)
 end
 
 --After 2 seconds show this message
 if(time()>2000)then
  print('Fugit inreparabile tempus',0,60)
 end 
end
Clone this wiki locally