yes you can.Zitat:
Zitat von Sousanator
Printable View
yes you can.Zitat:
Zitat von Sousanator
yeah. It says something like "attempt to call WaitVblankStart (nil value) help please!Zitat:
Zitat von Greenskull
EDIT: aha! The "w" was capitalized. im good now:D but how do I make my animation loop over and over until I press X again?
try this:Zitat:
Zitat von Greenskull
Code:white = Color.new(255, 255, 255)
frame_1 = Image.load("frame_1.png")
frame_2 = Image.load("frame_2.png")
frame_3 = Image.load("frame_3.png")
showAnimation = true
timer = Timer.new()
while true do
pad = Controls.read()
timer:start()
screen:clear()
if showAnimation then
if timer:time() >= 0 and timer:time() <= 135 then
screen:blit(0, 0, frame_1)
elseif timer:time() > 135 and timer:time() <= 270 then
screen:blit(0, 0, frame_2)
elseif timer:time() > 270 and timer:time() <= 405 then
screen:blit(0, 0, frame_3)
elseif timer:time() > 405 then
timer:stop()
timer:reset()
end
else
screen:print(0, 0, "Paused!", white)
end
if pad:cross() and pad ~= oldpad then
if showAnimation then showAnimation = false else showAnimation = true end
end
oldpad = pad
screen.flip()
screen.waitVblankStart(6)
end
here's the updated version of your deal or no deal script.it should work... it only takes each prize value once. from $0 to $1,000,000. The reason you had so many repeats is you had a couple prize values the same. This also displays the prize value in $0.00 format.Zitat:
Zitat von Grimfate126
Ok, the blipping stopped, but the highlighter doesn't move at all now. Which is fairly logic, because if right() is pressed, both pad and oldpad would be right(), so the if value would not be true.Code:pad = Controls.read()
oldpad = Controls.read()
if pad:right() and pad ~= oldpad then
x = x + 10
oldpad = pad
elseif pad:left() and pad ~= oldpad then
x = x - 10
oldpad = pad
end
if pad:start() then
break
end
Ah yeah thats what i thought. Its because you pause the loop by using the waitVblanck's. So what you have to do is make a timer and if the timer is at a specific value (the length of your music) then you play the other musicfile.Zitat:
Zitat von cools
@SjaakRake
I dont know why people use that code, but i know this works:With this it puts the value of pad in oldpad after everything is done, so when it does a new loop then it has the value of the last loop and that is what you want.Code:pad = Controls.read()
if pad:right() and pad ~= oldpad then
x = x + 10
oldpad = pad
elseif pad:left() and pad ~= oldpad then
x = x - 10
oldpad = pad
end
if pad:start() then
break
end
oldpad=pad
Haha, thanks, I'm so damn stupid, pretty logic.
PS. As you might have guessed, I'm dutch too, if you're interested in contacting me. PM me.
Ok, so it was the screen.waitVblank's that were messing up the code and I only need to change it to a timer. Thanks Altair!Zitat:
Zitat von Altair
no problem at all. Im looking forward to playing monopoly on my PSP!