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
schiffern#
If this isn't working for you on Firefox, check that dom.webaudio.enabled isn't set to false.

If Web Audio is disabled then window.AudioContext is undefined, causing a crash:

    Uncaught TypeError: AudioContext is not a constructor
        Sound https://d33wubrfki0l68.cloudfront.net/bundles/72f7c09a3e8485a33911cdf084acaeaf58ce17ce.js:5
        startGame https://d33wubrfki0l68.cloudfront.net/bundles/72f7c09a3e8485a33911cdf084acaeaf58ce17ce.js:482
mysterydip1 reply#
Just curious, what benefits do you see using a 280Hz refresh rate?
qrybam#
The benefits are mostly realised when playing games:

* Higher refresh rates means more frames can be displayed each second by the monitor
* Lower latency between some input action (mouse, keyboard) and the frame being drawn on the monitor (provided your game can run at a matching number of frames per second; FPS)
* Synching your FPS to refresh rate (e.g. if you're game can run at a locked 280fps and your monitor is running at 280hz) will remove tearing and provide a very smooth experience
On the desktop the benefits are less pronounced: Everything just feels a bit smoother, like moving your mouse point/open windows around the monitor.
Such high refresh rate displays normally aren't very colour accurate when compared to displays used for media editing.

Sydneyco1 reply#
This is funny. I feel this could evolve into a different game based on the number of players:

1 Player = Almost Pong
2 Players = Pong
3 Players = Pong + Almost Pong

isaacimagine1 reply#
3-player pong: two people control the paddle, one person controls the ball — switch off every time a point is scored? sounds like fun!
dylan6041 reply#
with no indicators to which player is controlling which object before the ball drops would cause another level of chaos in the fun
hoosieree#
and player roles should randomly rotate
andai1 reply#
Hey! Your 12 games in 12 weeks thing (back in ...2014? Jesus, time flies) was what got me into HTML5 game dev! So I wanted to say thank you for the inspiration :)

I especially appreciate the "loads no assets" aspect. I will take a look at the code in the morning!
p.s. have you considered the name "Flappy Pong"?

lessmilk1 reply#
That's awesome to hear! And yes my "one game per week" challenge was in 2014.

This game was definitely inspired by Flappy Bird, but no I didn't think about that name before today.

erikig#
I'm having a hard time believing it but Flappy Bird was launched over 8 years ago in 2013!

Load more comments