[WIP] Colorful Pong Clone [First Game]

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
peterrust
Prole
Posts: 42
Joined: Thu Dec 29, 2016 8:49 pm
Location: Bellingham, WA, USA
Contact:

Re: [WIP] Colorful Pong Clone [First Game]

Post 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.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: [WIP] Colorful Pong Clone [First Game]

Post 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!
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
ivan
Party member
Posts: 1918
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: [WIP] Colorful Pong Clone [First Game]

Post 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!
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests