Submit Your Own Code

PSP Lua CodeBase : Game Timer

Description:
its a game timer for if you want to count down to something

-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Game Timer
-- SUBMITTED BY: dtodabreezy

red=Color.new(255,0,0)
black=Color.new(0,0,0)

--i like this font becuz it dosent get in the way

proportional = Font.createProportional()
proportional:setPixelSizes(0,25)

--time for game
gametimer=Timer.new()
time=60
gametimer:start()

while true do
--gets time
gamestime=gametimer:time()
-- take this out to use in game
screen:clear(black)

--tells it count down 1 second every second
if gamestime>1000 then time=time - 1 gametimer:reset(0) gametimer:start()
end

screen:fontPrint(proportional, 220, 25, time, red)

Back to CodeBase
 

Please welcome anthonyjee, our newest member.

Who's Online:

Total Members: 522
Total Posts: 13085
Total Topics: 1515
Total Categories: 7
Total Boards: 42

Recent Posts:

Re: Hello every body... by DeniseVera
Need help please by Robbynator
Re: Hello every body... by horvathann
Re: background criminal record check by backgroundchecker
background criminal record check by backgroundchecker
Intro to Perl Part 2: What are Scalars? & Examples by Chi Kitory
Intro to Perl Part 1 About Perl and Hello World by Chi Kitory
Re: Trying To Get Rid of the Spammers by Charlie


Copyright © 2006-2009 www.EvilMana.com All rights reserved.
EvilMana Logo by emcp and Charlie