Log In  

Hello, I can't do this working and Idk why. For the tinyTVjam I'm making a tiny pinball and I'm trying to get the ball going up, but doesn't respond.
I try everything but the ball still going down.

ball.y+=ball.vely
ball.y+=ball.grav

--this for tests--
if ball.y>=5 then
  ball.vely*=-1
end
P#35908 2017-01-17 10:10 ( Edited 2017-01-17 15:39)

That's not a lot to go on. But, I'd expect to see gravity affecting the y velocity, not the y position. Maybe something like:

ball.vely+=ball.grav
ball.y+=ball.vely

P#35909 2017-01-17 10:29 ( Edited 2017-01-17 15:29)

Thank you! that did the trick!

P#35915 2017-01-17 10:39 ( Edited 2017-01-17 15:39)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-20 04:09:05 | 0.005s | Q:10