1.0.6 • Published 5 years ago
node-craters.js v1.0.6
node-craters.js
headless version node micro game development micro framework
- it's not a craters.js version for node but a minimal nodejs framework.
making a game 🚀
"use strict";
require('./craters/craters.js');
class mygame extends craters.game {
intitiate () {
super.intitiate();
// now intitiate my game
this.state.entities.push( new comet('f18'));
}
}
class comet extends craters.entity {
update () {
super.update();
// fly autonomously
this.state.accel.x = 0.10;
this.state.accel.y = 0.10;
// radio log
console.log( this.type + ' state:' + JSON.stringify(this.state));
}
}
window.cg = new mygame('#node', 800, 500, 60, false);