halfblock /

Filename Size Date modified Message
1.1 KB
MIT license
2.5 KB
Move discussion of features into README out of wiki
2.6 KB
Render a color-inverting reticule in GL, rather than with a image overlaying the canvas
202 B
First steps towards packaged Chrome app.
86.1 KB
Upgrade glMatrix to 2.0
112.6 KB
New 128x128 icon not a crappy blowup of a much lower res one.
19.1 KB
New 128x128 icon not a crappy blowup of a much lower res one.
6.9 KB
First steps towards packaged Chrome app.
8.4 KB
Spruce up the project icon a bit
12.3 KB
Show a little error info
153.6 KB
"Halfblock" logo
60.0 KB
"Halfblock" logo
113.7 KB
Fall onto a new plane of existence when you tunnel thru
472 B
Add some explanation of packaged app state-of-art
7.5 KB
Ruby and ruby ore
302.4 KB
Fix weird panorama coloring.
4.1 KB
Use an assertion to check correctness. (Attempts to speed this up have failed.);
70 B
Publish script to push to website
57.3 KB
Ruby and ruby ore
18.4 KB
Ruby and ruby ore

Halfblock

Halfblock is a Minecraft-a-like implemented in the browser using modern, HTML5 technologies:

  • WebGL
  • Pointer Lock API
  • Web Audio API
  • IndexedDB

It's mostly been developed/tested on Google Chrome, and an up-to-date version of Chrome is probably required to run it. Firefox might work also though there will probably be rot at any given time.

The goals of the project are to better understand the above APIs, to try ways of implementing various game features, be they copied or original, and to make something kind of cool. Minecraft is a great sandbox, but a Minecraft-like codebase is a sandbox sandbox. So each grain of sand is now a sandbox; you get me?

As it stands, the game is little more than a poor clone of Minecraft; nevertheless, it is a non-goal to duplicate Minecraft. I've implemented many features lifted from Minecraft for the sake of doing them myself.

It is an anti-goal to look at Minecraft's source code; rather I've based my implementations on behavior observed in-game, and general research on the web. See REFERENCES for links that have helped.

It isn't necessarily a goal to create something fun to play. This is more of a research and practice project than a game. If something fun (that isn't Minecraft) evolves from what I've done so far, so much the better.

Notes about some features

Web workers

Terrain generation (and perhaps, eventually, loading) are offloaded to a web worker to take advantage of multiple cores and reduce ugly pauses in the game. There are still pauses when a new chunk is generated, probably due to lighting updates.

Load/save

Forever poorly tested, load and save is implemented using the Indexed Database API. There's only one save slot as things stand.

Reticule

The targeting reticule is a color-inverted cross at the middle of the viewport. It is implemented by drawing WebGL lines over the scene with the blending function gl.blendFunc(gl.ONE_MINUS_DST_COLOR, gl.ZERO).

Planned features

Head bob

Based on field tests, it appears the MC head bob moves the camera sinusoidally left and right of center about 1/16 m, and up an down at around the same amplitude, or perhaps a bit less (but, as logic would dictate, at double the frequency). The POV camera moves smoothly back to the fixed position when motion stops, in perhaps 1/2 sec, and much quicker in the reverse direction.

The wavelength of the stride seems to be about 3m (per left + right step).