Skip to content
Kyuchumimo edited this page Jan 6, 2025 · 7 revisions
  • time -> ticks elapsed since game start

Returns

  • ticks : the number of milliseconds elapsed since the game was started

Description

This function returns the number of milliseconds elapsed since the game began execution. Useful for keeping track of time, animating items and triggering events.

Example

_TIC["PALETTE"] = [[0x14,0x0c,0x1c], [0x44,0x24,0x34], [0x30,0x34,0x6d], [0x4e,0x4a,0x4e], [0x85,0x4c,0x30], [0x34,0x65,0x24], [0xd0,0x46,0x48], [0x75,0x71,0x61], [0x59,0x7d,0xce], [0xd2,0x7d,0x2c], [0x85,0x95,0xa1], [0x6d,0xaa,0x2c], [0xd2,0xaa,0x99], [0x6d,0xc2,0xca], [0xda,0xd4,0x5e], [0xde,0xee,0xd6]] #DB16
# time demo

def TIC():
    cls()
    #Show rising time
    print('Seconds elapsed: ' + str(time()/1000))  
 
    #Blink warning
    if(time()%500>250):
        print('Warning!',0,30)
 
    #After 2 seconds show this message
    if(time()>2000):
        print('Fugit inreparabile tempus',0,60)

Clone this wiki locally