return to table of content

Show HN: 2d web paddle game

jsnell
13 replies
2d

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?

apgwoz
11 replies
1d23h

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.

pony_sheared
0 replies
1d16h

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

gazook89
0 replies
1d18h

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

Thanks

chrisweekly
0 replies
1d3h

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

airstrike
0 replies
1d17h

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

Cyphase
0 replies
1d14h

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

ComodoHacker
3 replies
1d11h

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

I believe different angles add complexity and fun.

apgwoz
2 replies
1d10h

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.

nkrisc
0 replies
1d8h

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.

ComodoHacker
0 replies
1d6h

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

RunSet
0 replies
1d4h

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.

dole
0 replies
2d

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!

tlh
6 replies
2d

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

umvi
5 replies
1d23h

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

quirino
2 replies
1d23h

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.

l3x4ur1n
1 replies
1d21h

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

thelastparadise
0 replies
1d17h

TMI

soneca
0 replies
1d22h

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! :)

Cyphase
0 replies
1d15h

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.

siavosh
4 replies
1d23h

Is there GPT involved?

pimlottc
2 replies
1d23h

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.

quirino
0 replies
1d23h

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

oneeyedpigeon
0 replies
1d8h

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

loeber
0 replies
1d22h

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

apgwoz
3 replies
1d23h

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.

jabroni_salad
2 replies
1d22h

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

seeingnature
1 replies
1d20h

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

apgwoz
0 replies
1d19h

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

waltbosz
2 replies
1d21h

Fun. Are there plans for local two player mode?

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

tibanne
0 replies
1d10h

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

nebulous1
0 replies
1d6h

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

shibeprime
2 replies
2d19h

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

30 seconds later<

Me: AAAAAAAAAAAAAAAAAAAAAHHHHHHHH!!!!!!!

redbell
0 replies
1d22h

30 secs later

Me: Oh! It's multi-pong war

Cyphase
0 replies
1d14h

This made me laugh out loud, thanks.

jareklupinski
2 replies
2d

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

feelin pretty good about that :)

mikepurvis
0 replies
1d16h

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.

aidenn0
0 replies
1d11h

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

simplify
1 replies
1d21h

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.

Cyphase
0 replies
1d14h

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.

JoeOfTexas
1 replies
2d20h

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

pretzellogician
0 replies
1d20h

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

poopsmithe
0 replies
1d3h

"best" is subjective.

wreq2luz
0 replies
1d19h

Yo this is sick!

w-ll
0 replies
1d20h

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

ungawatkt
0 replies
1d20h

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!

tbreschi
0 replies
1d23h

This is sooo much fun!

shooshx
0 replies
1d21h

Boy that escalated quickly

rajkumardongre
0 replies
1d21h

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

osm3000
0 replies
1d9h

That was a lot of fun! Thank you :)

martinbaun
0 replies
1d

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.

mapster
0 replies
1d21h

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.

lordelph
0 replies
1d23h

Jeff Minter-esque! Nice work!

kinduff
0 replies
1d18h

gpt's eyes don't dry out

hgs3
0 replies
1d16h

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.

frankbinette
0 replies
1d23h

That was fun to play!

flykespice
0 replies
1d4h

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 :)

fallinditch
0 replies
1d14h

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

egypturnash
0 replies
1d1h

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?

drivingmenuts
0 replies
2d20h

I dig it. Nice twist to it.

davyAdewoyin
0 replies
1d21h

Wow, That was nice to play.

blinding-streak
0 replies
1d11h

This is dope AF. Thanks for sharing!

asicsp
0 replies
1d12h

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).

asadm
0 replies
1d21h

MY FINGERS!

anon115
0 replies
1d19h

holy shit this is so fun <333

aavshr
0 replies
1d10h

this is absolutely great, multiplayer version?

Cyphase
0 replies
1d14h

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