Page 1 of 1
Re: [WIP] Colorful Pong Clone [First Game]
Posted: Sun Jan 22, 2017 10:48 pm
by peterrust
MP:
Good work! I like the colors, I was expecting a black background with neon-green paddles or something, so this was a pleasant surprise :-)
I'm not sure if you're looking for a bug reports yet, but if so, the ball got "stuck" twice (it was moving vertically, but not horizontally), once right in front of the AI paddle and once right behind the AI paddle.
Re: [WIP] Colorful Pong Clone [First Game]
Posted: Sun Jan 22, 2017 11:22 pm
by Positive07
If you want bug reports I may as well report that points weren't counted neither mines nor the AI's, also the ball got stuck when the AI lost it's point, and the AI had like a forcefield in front of him, the ball would be reflected even before it touched it's paddle...
Anyway, the game is looking great so keep it up!
Re: [WIP] Colorful Pong Clone [First Game]
Posted: Mon Jan 23, 2017 9:17 am
by ivan
Hello MadamPlumpette,
And thanks for checking out my humble tutorial!
The prototype you have going here is not bad, but I got the ball stuck at one point
it just bounces back and forth horizontally in front of the right paddle.
It happens due to following piece of code:
Code: Select all
if ball.x > 1000 then
...
ball.xv = -ball.xv
elseif ball.x < -50 then
...
ball.xv = -ball.xv
end
You can't just flip the velocity because if ball.x is greater than "1000 + max_possible_step" then the ball will get stuck.
You need an extra check, something like:
Code: Select all
if (ball.xv > 0 and ball.x > 1000) or (ball.vx < 0 and ball.x < 50) then
ball.xv = -ball.xv -- now it's safe to flip
Good luck!