PageRenderTime 17ms CodeModel.GetById 16ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/README

http://github.com/sbober/pocjs
#! | 51 lines | 31 code | 20 blank | 0 comment | 0 complexity | 787291aa90cb55b36077c5fb71906730 MD5 | raw file
 1PoC-JS
 2======
 3
 4This is a JavaScript port of the game 
 5"Prelude of the Chambered" by Markus "notch" Persson.
 6
 7Currently this is already working in current versions of Firefox,
 8Chrome/Chromium and likely also Safari (and other WebKit browsers). Support for
 9Opera and Internet Explorer 9+ is planned.
10
11The game looks best on Firefox as its canvas scaling can be made to _not_ use
12anti-aliasing. WebKit-based browsers produce a really squishy scale.
13
14Performance is acceptable although there surely are laggy moments.
15
16Some bugs are still to fix.
17
18Lessons learned
19----------------
20
21- CanvasContext.drawImage takes the PNG alpha channel into account.
22  The original pixel values are therefore not identical to
23  CanvasContext.getImageData(...).data
24
25- doing level design as graphics may be a good idea, storing level meta data
26  in the alpha channel may be not
27
28- having no Integer type sucks
29
30- having only function level scope sucks (no lexical scope? seriously?)
31
32- having the canvas engine scale an image is much faster than doing it
33  in JS (oh, really?)
34
35- all browsers use anti-aliasing when scaling by default.
36  Only Firefox can be told with
37
38    CanvasContext.mozImageSmoothingEnabled = false
39
40  to have a nice ruff, blocky scale
41
42- play testing a permadeath game that has no saves is annoying
43
44
45Copyright
46---------
47
48- Idea, code, assets (c) 2011 Mojang AB
49
50- Javascript port by Sebastian Bober
51