You are not logged in.
Here is my code. I want the text: "PAUSED --Press O to resume" to stay on the screen for a few seconds after I push X. Or maybe stay there until I press O. Right now it only displays when I am holding down the X button. Help please?
white = Color.new(255,255,255)
yellow = Color.new(255,255,0)
green = Color.new(0,255,0)
counter = Timer.new()
counter:start()
while true do
screen:clear()
pad = Controls.read()
currentTime = counter:time()
screen:print(10,10,"Counter Time: " .. currentTime,white)
if currentTime < 1000 then
screen:print(100,100,"Less than 1000",white)
end
if currentTime > 1000 and currentTime < 2000 then
screen:print(100,100,"Greater than 1000",yellow)
end
if currentTime > 2000 then
counter:reset(0)
counter:start()
end
if pad:cross() then
counter:stop()
screen:print(75,150,"PAUSED --Press O to resume",green)
end
if pad:circle() then
counter:start()
end
if pad:start() then
break
end
screen.waitVblankStart()
screen.flip()
endOffline
Anyone at all? I mean I know this section is dead but still...
Wait.. its not dead, I heard a cricket chirping in the background. ![]()
Offline
add this at the end of your code. Maybe this will help
screen.flip() while true do screen.waitVblankStart() end
Leaving the screen.flip() on the outside of the "while" cmd.
Hope this help, if you didnt get it.
Offline
your code should be this
white = Color.new(255,255,255)
yellow = Color.new(255,255,0)
green = Color.new(0,255,0)
counter = Timer.new()
counter:start()
while true do
screen:clear()
screen.flip()
pad = Controls.read()
currentTime = counter:time()
screen:print(10,10,"Counter Time: " .. currentTime,white)
if currentTime < 1000 then
screen:print(100,100,"Less than 1000",white)
end
if currentTime > 1000 and currentTime < 2000 then
screen:print(100,100,"Greater than 1000",yellow)
end
if currentTime > 2000 then
counter:reset(0)
counter:start()
end
if pad:cross() then
counter:stop()
screen:print(75,150,"PAUSED --Press O to resume",green)
end
if pad:circle() then
counter:start()
end
if pad:start() then
break
end
screen.waitVblankStart()
screen.flip()
endscreen:clear() and screen.flip() need to be in the loop

Offline