Discovered this web site just today, about 4 hours ago or so to be honest, and I have to say Love is by far an awesome and fast game making tool hands down!
Anyways was fiddling around with it and using bits and pieces from a previous flash game i did which is sort of like a pong game i converted that gradually into Lua a language i haven't used before but its very similar to Php and a buncha other languages I did so i picked it up pretty fast.
Ah .. i better cut to the chase lol
Code: Select all
if ballDir == "left" then
if x_ball <= 640 then
x_ball = x_ball - (speed_ball * dt)
end
if x_ball == 0 then
ballDir = "right"
end
else
if x_ball >= 0 then
x_ball = x_ball + (speed_ball * dt)
end
if x_ball >= 640 then
ballDir = "left"
end
end
What happens is this if you tell it to go right it will hit 640 and stop there. If you tell it to go left it will hit 0 and keep going .. which is rather funny to be honest haha
Anyways I think I need a fresh pair of eyes to check this bit out. Oh and if all of the source code is needed let me know I'll throw that on here as well
- Cheers