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 daryy, our newest member.

Who's Online: 2 Guests, 0 Users

Total Members: 556
Total Posts: 13060
Total Topics: 1480
Total Categories: 8
Total Boards: 35

Recent Posts:

Re: Lua 5.1.4 help. by daryy
Re: PGELua Help - need term for a special rotation fix (mathematical issue) by yaustar
Re: Lua Loader? by Buddy4point0
Re: Lua Loader? by osgeld
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl


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