Hello boys and girls!
I'm wondering if anyone of you know any good articles that has a focus on Pong.
What I want to see is something that talks about the paddle mechanics and the balls (heh) behaviour.
Thanks!
Any good Pong articles?
Any good Pong articles?
Have a good day!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Any good Pong articles?
I once wrote PÖNG - The Well Documented Version of PONG. Perhaps this will help you out?
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Any good Pong articles?
Oh nice!josefnpat wrote:I once wrote PÖNG - The Well Documented Version of PONG. Perhaps this will help you out?
What I would like to see is some form of documentation on why Pong works as it does, your coded example is really sweet but to me it doesn't really explain why some certain parts of your code does what it does.
If you could be so nice, can you add a .löve file so I could take a look at how the game plays?
Have a good day!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Any good Pong articles?
What parts can I extrapolate on? I am more than happy to expand the in-line documentation :)nice wrote:What I would like to see is some form of documentation on why Pong works as it does, your coded example is really sweet but to me it doesn't really explain why some certain parts of your code does what it does.
Attached is the code in the gist packaged in a .love
- Attachments
-
- PONG.love
- 7d4d9370
- (1.73 KiB) Downloaded 181 times
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Any good Pong articles?
The thing is that I want to replicate Pong and I want it to as close as possible to the original as possible and with that I can use it as a base for future projects.josefnpat wrote:What parts can I extrapolate on? I am more than happy to expand the in-line documentation
But what I'm curious about right now is the behaviour of the paddle and maybe the ball, how many directions does the paddle have? is the paddle divided up in parts?
Is there a standard for the speed of the ball? does it have direction values too?
Have a good day!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Any good Pong articles?
A 1:1 copy of Pong may prove to be very difficult, but an interesting goal nonetheless. There are many many versions of pong, and you will want to decide on which one you want to emulate. I believe the initial pong was created by Allan Alcorn as a training exercise, so it is all done in hardware.nice wrote:The thing is that I want to replicate Pong and I want it to as close as possible to the original as possible and with that I can use it as a base for future projects.
Here is an image of the schematic that may provide you with more information:
https://gist.github.com/josefnpat/a1abc ... in-lua-L64nice wrote:how many directions does the paddle have?
Two directions. "Up" and "Down"
https://gist.github.com/josefnpat/a1abc ... in-lua-L14nice wrote: is the paddle divided up in parts?
No, the paddle has a x,y,w and h. from that a collision can be determined: https://gist.github.com/josefnpat/a1abc ... in-lua-L31
The speed is defined here: https://gist.github.com/josefnpat/a1abc ... in-lua-L22nice wrote:Is there a standard for the speed of the ball?
For whatever you consider the "original" version of pong, I do not know. You would have to research that.
The direction is swapped between the players.nice wrote:does it have direction values too?
https://gist.github.com/josefnpat/a1abc ... in-lua-L28
I believe that is how the original version did it.
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Any good Pong articles?
Oh god, that's a lot of stuff..josefnpat wrote:nice wrote:how many directions does the paddle have?
By directions I meant how many ways can the paddle bounce back the ball like this: And as you said, making a game that's as close to the original would be difficult but I want to make as close as possible.
Sorry if I wasn't clear enough I'm a bit tired while typing this
Have a good day!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Any good Pong articles?
[quote="nice"]
Now I understand!
The vy (vertical velocity of the ball) is calculated by the percentage offset away from the center of the paddle.
https://gist.github.com/josefnpat/a1abc ... in-lua-L36
/quote]Now I understand!
The vy (vertical velocity of the ball) is calculated by the percentage offset away from the center of the paddle.
https://gist.github.com/josefnpat/a1abc ... in-lua-L36
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Any good Pong articles?
Could you explain further what it does? personally I don't really know what's happeningjosefnpat wrote:nice wrote:/quote]
Now I understand!
The vy (vertical velocity of the ball) is calculated by the percentage offset away from the center of the paddle.
https://gist.github.com/josefnpat/a1abc ... in-lua-L36
Have a good day!
Re: Any good Pong articles?
The variable vy (Vertical Velocity in this case) determines the vertical direction of the ball. When the ball collides with the paddle it checks where on the paddle it has collided; the higher up the collision was the lower it sets the velocity, the lower the collision was the higher it sets the velocity.nice wrote:Could you explain further what it does? personally I don't really know what's happeningjosefnpat wrote:nice wrote:/quote]
Now I understand!
The vy (vertical velocity of the ball) is calculated by the percentage offset away from the center of the paddle.
https://gist.github.com/josefnpat/a1abc ... in-lua-L36
Who is online
Users browsing this forum: Bing [Bot], casual_dodo and 3 guests