Hi guys,
I'm working on a small minigame (Guitar Hero!) and I wanted to let os.pullEvent(key) check if I pressed a key.
However, os.pullEvent doesnt work that way and it just waits 'till I press the key...
Is there anyway it will not wait, and just see that I pressed a key or not, AND return what key I pressed?
Thanks in advantage.
I dont want to wait on os.pullEvent
Started by Tjakka5, Jan 31 2013 07:48 AM
1 reply to this topic
#1
Posted 31 January 2013 - 07:48 AM
#2
Posted 31 January 2013 - 08:04 AM
use an ingame timer that updates the pixels in the game (in your case the guitar tab thingys..)
edit: forgot something..
refreshTime = 0.18 gtID = os.startTimer(refreshTime) ev,p1 = os.pullEvent() if ev == "key" then if p1 == keys.a then --insert code here end elseif ev == "timer" and p1 == gtID then gtID = os.startTimer(refreshTime) --insert code here to update game end
edit: forgot something..
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











