Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: 2d web paddle game (raould.github.io)
309 points by cypherpunk666 7 months ago | hide | past | favorite | 71 comments
Simple retro paddle arcade game written in Javascript, using good ol' Canvas.



Very cool!

The physics seem very different from classing pong / arkanoid physics, where the angle is determined by which part of the paddle was hit. Instead it seems like it's maybe totally random within a fairly small cone around the horizontal axis. Is that intentional?


I've never "studied" "paddle dynamics" in these games, and when implementing pong, always just reflected, which doesn't provide good game play, but pong is always a "I'm trying out a different framework" type exercise.

Pong using where it hits to affect the angle never totally made sense to me. I assume the explanation is "the paddle is drawn as a rectangle, but is actually parabolic." Additionally, I've always wondered why I've never seen a pong where the paddles have acceleration to some maximum velocity, and if the paddle is not stationary, you get lateral spin, causing non-linear ball paths on the return hit.


There's an old 3d pong game from the flash era where you put spin on the ball.

https://www.crazygames.com/game/curve-ball-3d


Thanks for sharing! Perfect game until Level 6, died on level 7 with 21,150 points.


You reminded me of one of the first Mac games I got as a kid: Shufflepuck Cafe, I don't think it had spin but the sideways speed of your mouse was imparted on the puck


Soooo satisfying, thanks for sharing. Now I also feel like writing my own version


My god I forgot about this, and probably for the better. Too many hours wasted on it.

Thanks


Oh yeah! I forgot about this one. Thanks for the link.


> Pong using where it hits to affect the angle never totally made sense to me. I assume the explanation is "the paddle is drawn as a rectangle, but is actually parabolic."

It doesn't have to be realistic, only fun. The justification (very much not an explanation) is that it is more fun if the player can affect the angle of the rebound by positioning the paddle.

It's also not realistic for Mario to change his jump's arc after he leaves the ground but the "rule of cool" holds in the Mushroom Kingdom, too.


>using where it hits to affect the angle never totally made sense to me

I believe different angles add complexity and fun.


Well yes, of course. The way the different angles are computed isn’t intuitive. If a ball bounces off a table, it doesn’t change direction from its normal reflected bounce just because it didn’t hit the center.

That’s why I’m suggesting there must be something that guides the idea that hit position changes the angle. If the paddle was actually parabolic, and just drawn as a rectangle, that’s an intuitive reason for the different reflective angles.


> That’s why I’m suggesting there must be something that guides the idea that hit position changes the angle.

Fun. The guiding principle for all games should be: is it fun?

The reason the position of impact determines the angle is because it’s more fun, Not because it’s realistic.

Realism is rarely fun.

It’s a game, not a physics simulation.

Edit:

Additionally, if you only implement perfect reflection and have a rectangular arena, then the only bounce angles that can occur are the initial ball angle A and 90 - A on the top and bottom sides. That’s not fun.


I believe the idea was to give the player more control with limited input signals.


I love Arkanoid and other pong-alikes, so also I'm curious about seeing how deflection angles on paddle location hit would play. Great design, music and play!


Bullet Hell Pong. Brilliant. Is there a win state? I just kept on playing until I hit the back button…


When there are no balls left in play, the game is over. If you have more points at game over, you win.


In that case I think the strategy would be to create a lead and then let all the balls through so that the game ends. At the start I was winning but at some point I wasn't able to keep up anymore.


That was my strategy when I realized I sat on the toilet for too long already


TMI


Ah, thanks. I paused and came back here, saw this comment, then went back and let the balls go by. Okay, I'll be honest, I accidentally unpaused early and they went by before I had a chance to think about whether I had enough of a lead. I did! Final score 405, the difference between my score and the bot's.


I didn’t know it was when no balls were left. So this time I got an initial game, jumped ahead after using a special, then let all balls pass. I won by two points! :)


Very cool, nice design, much of the satisfaction comes from the sounds ++



"best" is subjective.


Is there GPT involved?


Same question here. When I saw its name, my first thought was "a transformer that plays pong? Interesting"


Yeah, that doesn't make sense to me, unless we're now just using "GPT" as a generic word for "AI" (i.e. computer player) now.


That's exactly what I assumed it was — a wry commentary on AI.


My first thought was that the AI of the bot was code written by GPT.


Fun. Are there plans for local two player mode?

Also, when was this made? The copyright notices say 2011.


To me it looks like they wrote the base game in 2011 and then spent the past few weeks finishing it off.


Looks like there is a 2 player branch in the works. Can't wait to play it.

https://github.com/raould/pn0gstr0m/tree/2p


Same question... would like to play someone at home.


Challenge 1: Win the game with the lowest lead you can get. Or tie.

Challenge 2: Win the game with the least number of points; total points, before the bot's points are subtracted.

My first attempt at this (which was my second game) I won with 442 - 405 = 37.

EDIT: Second attempt, this time on mobile: 43 - 35 = 8


15 - 9 = 6


Awesome game! Best pong variant I've played!

Would be great to have an end goal. I managed to maintain a 200pt lead up to 1300pts and decided to give up cause I didn't know how long it would go.


As I learned from other comments, the game ends when all the balls are out of play. Whoever is in the lead wins, and your final score is the amount of the lead. So you can allow the balls to get past you and go out of play to end the game, but make sure you have enough of a lead first!

Hmm, next I'll see how low of a score I can have and win the game.


It wasn't until I read the comments that I actually gave it a chance. Would love to see a "Oh, you think it's Pong? It's not!" indicator on the page.


But that would rob you of the little a-ha moment when you realize the subversion :(


Yup - and that was worth it! I love a good a-ha moment.


I agree, it's fun. However, who wants to play pong? It's not exactly a flashy "CLICK ME" type game.


I was thinking "okay I think I am about done with this, I am at 2.5k to 2k", and then the game spawned a "defend" powerup for the computer player, which blocked off the entire computer side with destroyable blocks, and I decided I was done. 2721 to 2167.

Cute idea, could be kinda fun with another human, maybe with some way to push a button to lose points in exchange for a powerup on your side?


Holding down one arrow key and only pressing the other makes directional changes much quicker, since the second press overrides but doesn't cancel the first.

Very fun!


Boy that escalated quickly


I never thought that I would spend so much time in a ping pong game, really amazing work.


I liked it but would suggest maybe changing the orientation so you can use left/right instead of up/down. i was playing way better once i rotated my keyboard so i could use two fingers


That was really cool. Nice of you to include a warning, but I wish there was a light-theme mode (or may be there was one and I missed it).


Very cool. You can control the paddle with the mouse by holding left click. I missed that my first playthrough and used the arrow keys.


gpt's eyes don't dry out


powerups had to start spawning on the CPU's side to keep it fair

feelin pretty good about that :)


At first the CPU was beating me as it could jump around to get more of the balls returned, but once it was thick enough I pulled ahead as I seemed better able to aim for returning the big clusters.


Yeah, I was winning until the CPU got the space-invaders style barrier when there were like 100 balls in play.


I dig it. Nice twist to it.


This is sooo much fun!


That was fun to play!


Holy balls, so many. Great game. I got a high of 550.


Very cool game! 757 high score; the power-ups keep getting more interesting.


I thought it would go on forever but I made it 'till the end.

Final Score: 2071 - 1715 = 356

Damn I did pretty good against GPT, it seems like AI still has so much to learn from humans :)


This is dope AF. Thanks for sharing!


That was a lot of fun! Thank you :)


Jeff Minter-esque! Nice work!


I love these comments

// Welcome to The Land of Global Varibles, And Inconsistent Naming.

//

// sorry: velocities are kinda hacky guesstimates;

// the naming is horrible just about everywhere;

// this code is probably like 85.2% bugs or bad taste.

//

// note: my use of

// "left" is -x in canvas coordinates;

// "up" is -y in canvas coordinates;

// ideally (x,y) of objects consistenly means (left,top).

//

// note: the noyb2 font only has upper case letters,

// with a few icons in the lower case.


Wow, That was nice to play.


My progression: Ok. Oh it’s like that? I got you. Oh fuck you. Oh fuuuuck you!!

Love this. Really need a paddle input device on the iPhone.


this is absolutely great, multiplayer version?


Yo this is sick!


MY FINGERS!


holy shit this is so fun <333


Me: Oh , so it's pong... wait, why is there TWO balls?

>30 seconds later<

Me: AAAAAAAAAAAAAAAAAAAAAHHHHHHHH!!!!!!!


> 30 secs later

Me: Oh! It's multi-pong war


This made me laugh out loud, thanks.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: