Code Incomplete
codeincomplete.com · Personal blog · on HN since 2011
Jake Gordon writes about JavaScript and HTML5 game development, including a racing game, a platformer, Boulder Dash and CSS sprite packing.
What HN saysHN commenters recommend its JavaScript game write-ups, especially the pong tutorial and the Outrun-style racer, and discuss its bin-packing approach.
20HN people shared it
9linked it in comments
11stories submitted
137story points
3 years agolast shared
2011people per year2026
Most-shared posts
- 1How to build a racing game4 people · 114 points · first shared 2012 · 16 comments on HN
- 2How to build a racing game in JavaScript2 people · 4 points · first shared 2012 · 1 comments on HN
- 3Open Source JavaScript Games2 people · 2 points · first shared 2015 · discussion on HN
- 4Bin-Packing Algorithm for CSS Sprites2 people · 1 points · first shared 2022 · discussion on HN
- 5Boulder Dash in JavaScript1 people · 6 points · first shared 2011 · discussion on HN
- 6Rotating Tower Rendering1 people · 3 points · first shared 2013 · discussion on HN
- 7Software Startup Roles1 people · 3 points · first shared 2014 · discussion on HN
- 8Software startup roles1 people · 2 points · first shared 2017 · 1 comments on HN
- 9Tiny Platformer: Creating a small platform game with HTML5 Canvas1 people · 2 points · first shared 2013 · discussion on HN
- 10Javascript pong1 people · first shared 2019
- 11Javascript tetris1 people · first shared 2023
- 12Example1 people · first shared 2011
- 13Javascript state machine v21 people · first shared 2011
- 14Javascript racer1 people · first shared 2021
- 15Homepage1 people · first shared 2012
What HN people wrote when they linked it
jakesgordon · 2012-06-25
I have purchased a few tracks from Lucky Lion studios in the past for some personal projects (http://codeincomplete.com/) and been very happy.
I highly recommend them.
Good luck(y lion)!
rednab · 2022-07-12
The bin packing problem is NP-hard, but rectangle packing is "merely" NP.
However, most people just use a recursive biggest-fit-first ¹), a simple heuristic that is surprisingly hard to beat for most workloads.
I couldn't figure out what Aseprite is doing from their website or documentation, but if it's not that then it might be worth it writing your own sprite packer.
¹) https://codeincomplete.com/articles/bin-packing/
zappo2938 · 2015-10-05
Jake Gordon at Codeincomplete.com has lots of great write ups about javascript game development. It's worth checking out. Start with the pong implementation to see the most basic parts of a game including game loop, painting to canvas, and collision detection. http://codeincomplete.com/games/
chrisco255 · 2023-05-30
Right, but efficient can mean a lot of things.
Though Java was used, this game is inaccessible to Mac, iPhone, and Android users. Porting to all these platforms is inefficient compared to just using the web.
It also requires a 60MB download, which is not very space efficient for a relatively simple 2D game (NES Tetris fit on a 24KB ROM). People have implemented Tetris in as little as 446 bytes [1]. Full color JS versions have been done at 16KB or less [2][3]. A JS version from 2004 came in at 1.5kb [4].
Haven't done memory efficiency analysis, but willing to bet the average JS Tetris implementation has dramatically better memory efficiency as well.
[1] https://hackaday.com/2016/10/06/tetris-in-446-bytes/
[2] https://github.com/cztomczak/jstetris
[3] https://codeincomplete.com/articles/javascript-tetris/
[4] https://joriszwart.nl/games/javascript-tetris-1.5kb
dataviz1000 · 2021-11-28
Here is another example of making a 3D look with 2D graphics using JavaScript from the CodeIncomplete blog building an Outrun type car racer game, https://codeincomplete.com/articles/javascript-racer/.
keeper7777 · 2019-01-27
Implementing a game loop in JavaScript (2011) [0]
[0] https://codeincomplete.com/posts/javascript-pong/
tluyben2 · 2015-01-06
For people who do not know this related tut; http://codeincomplete.com/posts/2012/6/23/javascript_racer_v1_straight…
qohen · 2011-09-01
There are other JS FSM libraries, but I ran into this one recently, which has an online demo:
The blogpost about it:
http://codeincomplete.com/posts/2011/8/19/javascript_state_machine_v2/
The online demo:
http://codeincomplete.com/posts/2011/8/19/javascript_state_machine_v2/…