Hi,
I am not really a lua programmer, just found out about the PSP luaplayer.
Looking at your code there are a few points.
a) You are using ==, and = interchangeably. Not sure on the lua syntax but if it is similar to C then your second comparison with time,is actually an assignment.
b) I have to assume that you are initialising yP to something useful somewhere?
c) The second comparison with time will never occur (even with it corrected to be a comparison rather than an assinment) as you are clearing time to zero.
d) Indent your code and mistakes like this are easier to see.
try something more like
Code: Select all
height=70
time =0
.
.
if pad:cross() then
time=time+1
if (time>=height) then
yP=2*height-time
else
yP = time
end
if (time> (2*height)) then
yP=0
end
end
To give the bounce a bit more 'bounce; try setting the height using a sine wave function.
CC