Lurker News
Hi HN!

I made many small web games in the past with Unity or Phaser. But this time I wanted to make something completely on my own. So I coded a basic game framework in plain JavaScript, and used it to make Almost Pong.
This was a really fun project that taught me a lot about JavaScript, and I plan to make more minimalist games with this framework. Interesting fact: Almost Pong doesn't load any assets, all sprites and sounds are generated with code.
Happy to answer questions, and please let me know if you have any feedback on the game. Thanks!

Comments (181) 117 threads

Earlier comments
justinhj2 replies#
Really fun and addictive. I would extend the screen downwards so there is a clickable area that is not part of the play area. Then you will be able to see what is going on better. Just an idea.
boomboomsubban#
Yeah, on mobile my thumb blocking the paddle made it much harder, which led to me clicking the extreme side until I accidentally opened my side bars and lost.
lessmilk1 reply#
That's a good point. I'll see what I can do about this, thanks!
cush#
It would be great if tapping anywhere on the page made the ball jump.
creakingstairs2 replies#
This was pretty fun to play. Half way through the game I realised this was like flappy birds but within one screen. In saying that, this felt more fun to me because the space between each challenges was bigger, letting me I feel like I was more in control.
threeboy#
I also saw the Flappy Pong similarties.
lessmilk2 replies#
Yes, I was definitely inspired by Flappy Bird for this game. I could have called it Flappy Pong I guess.
inimino#
I came to the comment section just to say that I was surprised this wasn't called Flappy Pong.

Nice game!

skocznymroczny#
Pongy McPongface
Laremere4 replies#
Be careful, especially if you do anything commercial with this: "Pong" is trademarked by Atari. Fun game, but might need to choose a different name...
kaptain#
“Not Trademarked Pong” would be the snarky name for it. But probably wouldn’t hold up in court.
skywal_l#
Call it Ping then.
ok_dad#
Call it "Bong" because in "Pong" you control the [P]addles but in "Bong" you control the [B]all. Is that too close to the trademark, though?
Wingy#
I find it fun to write scripts to play games like this, here's my solution:

    setInterval(() => {
      function jump() {
        function fireSpaceBarToDocumentElement(eventName) {
          const SPACE_BAR = 32
          const ev = new KeyboardEvent(eventName, { bubbles: true, keyCode: SPACE_BAR })
          document.documentElement.dispatchEvent(ev)
        }

        fireSpaceBarToDocumentElement('keydown')
        fireSpaceBarToDocumentElement('keyup')
      }

      function shouldJump() {
        function goingLeft() { return ball.speedX < 0 }
        function goingRight() { return ball.speedX > 0 }
        function leftPaddleAboveBall() { return ball.y < paddle1.y }
        function rightPaddleAboveBall() { return ball.y < paddle2.y }
        if (goingLeft() && leftPaddleAboveBall()) return true
        if (goingRight() && rightPaddleAboveBall()) return true
        return false
      }

      if (shouldJump()) jump()
    }, 1)

Load more comments