Generis2d is a free open source game engine that allows novice to proffesional 2D web game development entirely online.
Generis2d is a standalone library and hence requires no other library or plugin to be installed.
Using generis2d is very simple and intuitively easy.
First add the library to your html file
<script src="https://cdn.rawgit.com/Nangue-Tasse/generis2d/8ecb78b/generis2d.min.js"></script>
Disclaimer: It's a free service, so there are no uptime or support guarantees.
Here is a minimum example using generis2d
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdn.rawgit.com/Nangue-Tasse/generis2d/8ecb78b/generis2d.min.js"></script>
</head>
<body style="background-color:#000">
<script>
var scene = G.new("scene"); // New Scene
// Bodies definition
var bodies = { idle: { x:100, y:100, frames: ["http://generisengine.appspot.com/data/images/logo11.png"] } };
// New entities
scene.new( "entity", { idleBody: "idle", bodies: bodies } );
scene.start(); // Start Scene
</script>
</body>
</html>
- GameEngine.Scenes // dictionary
- GameEngine.canvas // object
- GameEngine.activeScene // string
- GameEngine.loaded // integer
- GameEngine.WtoH // float
- GameEngine.new(type, params) // params optional
type | params |
---|---|
canvas | {id:[canvas id], container: [canvas container], width: [canvas width], height: [canvas height]} |
scene | {id:[scene id], canvas: [scene canvas], width: [scene width], height: [scene height]} |
- GameEngine.start(type, params) // params optional
type | params |
---|---|
scene | {id:[scene id]} |
- SceneEngine.id // string
- SceneEngine.width // float
- SceneEngine.height // float
- SceneEngine.entities // dictionary
- SceneEngine.cameras: // dictionary
- SceneEngine.activeCamera // string
- SceneEngine.events // dictionary
- SceneEngine.eventListeners // dictionary
- SceneEngine.time // integer,
- SceneEngine.pause // boolean
- SceneEngine.entityParams // dictionary
- SceneEngine.time // int
- SceneEngine.new(type, params) // params optional
type | params |
---|---|
camera | {id:[camera id], x:x, y:y, z:z, width: [camera width], height: camera height]} |
entity | {id:[entity id], idle: [entity idle body], zIndex: [entity zIndex], bodies: [entity bodies deffinition]} |
- SceneEngine.add(type, params) // params optional
type | params |
---|---|
enventListener | {id:[enventListener id], pre: [ function ], post: [ function ]} |
- SceneEngine.set(type, params) // params optional
type | params |
---|---|
gravity | {x:[ x component], y:[ y component]} |
sort | {type:[ascend or decend], sort:[ function ]} |
- SceneEngine.start()
- SceneEngine.close()
- CameraEngine.id // string
- CameraeEngine.width // float
- CameraEngine.height // float
- CameraEngine.Position // dictionary
- CameraEngine.Size // dictionary
- CameraEngine.events // dictionary
- CameraEngine.eventListeners // dictionary
- CameraEngine.time // int
- CameraEngine.add(type, params) // params optional
type | params |
---|---|
enventListener | {id:[enventListener id], pre: [ function ], post: [ function ]} |
- CameraEngine.set(type, params) // params optional
type | params |
---|---|
position | {x:[ x component], y:[ y component], z:[ z component]} |
size | {width:[ camera width], height:[ camera height]} |
- CameraEngine.get(type)
- EntityEngine.id // string
- EntityEngine.body // box2d object
- EntityEngine.bodies // dictionary
- EntityEngine.activeBody // string
- EntityEngine.idleBody // string
- EntityEngine.zIndex // int
- EntityEngine.frame // int
- EntityEngine.eDraw // int
- EntityEngine.eDebugDraw // int
- EntityEngine.offset // dictionary
- EntityEngine.alpha // 0 <= float <=1
- EntityeEngine.width // float
- EntityEngine.height // float
- EntityEngine.Position // dictionary
- EntityEngine.Size // dictionary
- EntityEngine.events // dictionary
- EntityEngine.eventListeners // dictionary
- EntityEngine.time // int
- EntityEngine.add(type, params) // params optional
type | params |
---|---|
enventListener | {id:[enventListener id], pre: [ function ], post: [ function ]} |
body | {body:[body definition]} |
frame | {frame:[frame url]} |
- EntityEngine.set(type, params) // params optional
type | params |
---|---|
position | {x:[ x component], y:[ y component], z:[ z component]} |
size | {width:[ Entity width], height:[ Entity height]} |
offset | {position:{x:x,y:y,z:z}, size:{width:width,height:height}} |
alpha | {alpha:[ alpha]} |
frames | {frames:[frames url array]} |
body | {x:x,y:y,z:z,width:width,height:height,groupIndex:groupIndex,offset:offset,alpha:alpha} |
- EntityEngine.get(type)
- Pure Javascript
- Box2d
- Geraud NT - (https://github.com/Nangue-Tasse)
This project is licensed under the MIT License - see the LICENSE.md file for details
- Inspiration from Udacity course: HTML5 Game Developement
- Box2d great physics library