FBA The Creator

The True Multiplatform PC / PocketPC Opensource Development Tool - Read Only Mode - Kept only for historical purposes - Thank you all ;)
It is currently Mon Jun 17, 2019 3:06 pm

All times are UTC




Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Countdown Timer
PostPosted: Thu Jun 26, 2008 8:03 pm 
Offline
Tutorials Contributor
Tutorials Contributor
User avatar

Joined: Tue Jun 17, 2008 3:39 am
Posts: 59
Location: Midwest, US
This small code is just a proof-of-concept for creating a timer in FBA. As written, it counts down from ten and closes the program when it reaches 0. This provides the basis for all sorts of timers and will hopefully be of some help to someone.

Code:
local startCount=10
local now=clock()
local count=startCount

function onmainloop()
  clear(0,0,0)
  count=startCount-math.floor((clock()-now)/1000)
  if count<=0 then quit() end
  print(50,50,count,255,255,0)
end

_________________
Don't look at me. I'm new here.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited