timer:reset(0)Zitat:
Zitat von MistabeenCould someone take a look at this code, for some reason I get in my Debug (working with LuaDevKit)
Exit Value: 1
usage: luaplayer script.lua
If I open another script it opens just fine, so I guess I must be not seeing something that is probably so obvious :p
Spoiler for Lua code:-- colors --
red= Color.new(255,0,0)
green= Color.new(0,255,0)
white= Color.new(255,255,255)
yellow= Color.new(255,226,40)
-- Timer --
counter = Timer.new()
counter:start()
-- images --
bighit= Image.load("bighit.png")
-- music table --
notes={}
notes[1]={time=5000,note=1}
notes[2]={time=7000,note=1}
notes[3]={time=10000,note=1}
notes[4]={time=12000,note=1}
-- vars --
oldpad = Controls.read()
-- Main loop --
while true do
pad = Controls.read()
screen:clear()
currentTime = counter:time()
screen:blit(50,50,bighit)
screen.waitVblankStart()
oldpad=pad
screen.flip()
end
-= Double Post =-
I eventualy found what was wrong, for some reason my filename was to big :p kinda silly
I've got another problem tho
is there any decent soundsupport for LUA? or is there a way to preload my musicfiles, or is there a way to reset my timer as soon as the music starts playing.
Right now I had to use wav for my music (.xm file was the worst thing ever) and that plays, only problem is there is a delay and I need my music to be in perfect sync with my timer.
