Jeez
Game Engine with ThreeJs renderer
Build
Run npm install
followed by npm run dev
or npm run build
to generate the built library
Getting Started
- Include
jeez.js
orjeez.min.js
in your html orrequire
it orimport
it. - Initialize Jeez with
var jeez = new Jeez({container: <container name>})
where container is the id of the div inside which the THREE canvas will be created - Create an object that looks like this -
var state = {
create: function() {
var material = new THREE.MeshNormalMaterial(); // create a basic material
var geometry = new THREE.CubeGeometry(10,10,10); // create a cube geometry
var cube = new THREE.Mesh(geometry, material); // create a cube
cube.position.z = -10; // set its position a little further away from the camera
cube.rotation.x = 10; // rotate the cube
cube.rotation.y = 10; // rotate the cube a little more
this.camera.position.z = 10; // move the camera a little further back
this.world.add(cube); // add the cube to the scene
}
}
- Add the newly created state to the state manager with
jeez.state.add('main', state, true) // where the last argument starts the state automatically
Currently implemented
- Rudimentary state manager
- Render update with
requestAnimationFrame
with fallback tosetTimeout
- Extended
THREE.Object3D
to supportupdate
methods - Lights, with
game.lights
- Basic scalemanager
- Asset preloading
Created mostly (copied?) by looking at what Phaser does, with a little bit of Cocos2d-JS.