Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
oberhamsi / gamejs.index.html
Created December 23, 2010 18:34
default app template
<!-- gamejs needs those 2 lines --->
<% extends './skins/app.html' %>
<% subskin content %>
<!-- gamejs will create #jsgamecanvas if it's not present --->
<canvas id="jsgamecanvas"></canvas>
<!-- your html, <script>, etc... --->
<link href="styles.css" rel="stylesheet" type="text/css" />
<!-- Import EaselJS Framework -->
<script src="../com/gskinner/utils/UID.js"></script>
<script src="../com/gskinner/display/SpriteSheet.js"></script>
<script src="../com/gskinner/display/Shadow.js"></script>
<script src="../com/gskinner/display/DisplayObject.js"></script>
<script src="../com/gskinner/display/Container.js"></script>
<script src="../com/gskinner/display/Stage.js"></script>
<script src="../com/gskinner/display/Bitmap.js"></script>

Game Engines

Name Latest Release Size (KB) License Type Unit Tests Docs Notes
The Render Engine 1.5.3 MIT Cross-browser; extensive API; open-source. 2
gameQuery 0.5.1 CC BY-SA 2.5 Designed to be used with jQuery
gTile 0.0.1 (2008-07-21) Tile based
Akihabara 1.3 GPL2/MIT Classic Repro Intended for making classic arcade-style games in JS+HTML5 3
The Javascript 2D Game Engine GPL Emphasis on gravity/physics/collision detection; uses HTML5 Canvas and ExplorerCanvas for IE support. Focus on limiting CPU usage. 4
The GMP Javascript Game Engine
@oberhamsi
oberhamsi / linewrap.js
Created February 16, 2011 18:48
simple line wrap, kind of inspired by easeljs
function measureWidth(line) {
return line.length;
};
// DANGER: endless loop possible of two consecutive words are longer than lineWidth
var wrap = exports.wrap = function(text, lineWidth) {
var lines = String(text).split(/\r\n|\r|\n/);
var wrapped = [];
for (var i=0; i<lines.length; i++) {
var line = lines[i];
@oberhamsi
oberhamsi / minimal-gamejs.js
Created February 16, 2011 19:55
a minimal gamejs app
// Minimal is the smalles GameJs app I could think of, which still shows off
// most of the concepts GameJs introduces.
//
// It's a pulsating, colored circle. You can make the circle change color
// by clicking.
//
// Play: <http://gamejs.org/apps/minimal/>
var gamejs = require('gamejs');
@oberhamsi
oberhamsi / kontrollstring.py
Created February 28, 2011 10:12
sanity check cha files
# -*- coding: utf-8 -*-
'''
Kontrollstring von %cod
Beispiel:
%cod: $:VMS#+Tdx|kommen:PR:DAC:EL1/1&+Tdx|her:EO2/2&|mit-hannah(com):EZ3/2&|:EZ4/2&|:EZ5/2&|:PM0:{}
%cod: nur diese Zeilen sollen in einem cha File kontrolliert werden
Beginn: $ oder €
Ende: }
Mitte: 10 Doppelpunkte/10 Felder :
var http = require('ringo/httpclient');
var {defer} = require('ringo/promise');
var {MemoryStream} = require('io');
var {AsyncResponse} = require('ringo/webapp/async');
var app = exports.app = require('stick').Application()
.configure('error', 'notfound', 'route', 'params');
app.get('/proxy/*', function (request, path) {
var response = new AsyncResponse(request);
var http = require('ringo/httpclient');
var {defer} = require('ringo/promise');
var {MemoryStream} = require('io');
var {AsyncResponse} = require('ringo/webapp/async');
var app = exports.app = require('stick').Application()
.configure('error', 'notfound', 'route', 'params');
app.get('/proxy/*', function (request, path) {
var response = new AsyncResponse(request);
@oberhamsi
oberhamsi / gamejs-quickstart.sh
Created March 25, 2011 20:30
gamejs-quickstart
$ cd gamejs
$ mkdir examples/demo
# The app is instantly viewable at: http://localhost:8080/demo/
# after creating the `demo` folder and a `main.js`
$ echo "
var gamejs = require('gamejs');
gamejs.ready(function() {
@oberhamsi
oberhamsi / rng.js
Created April 13, 2011 14:25
random number generator, as seen on michalbe's blog
/**
* ent 8? don't use
*
* @example
*
* var rng = new CustomRandom();
* rng.next();
* rng.next(2, 100);
*
* @see http://michalbe.blogspot.com/2011/02/javascript-random-numbers-with-custom_23.html