mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
restructured repository
This commit is contained in:
parent
cc6279eac9
commit
080a2e410c
38 changed files with 87 additions and 26 deletions
54
tests/game-draft/js/Chuck/Processor.js
Executable file
54
tests/game-draft/js/Chuck/Processor.js
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
Chuck.Processor = function() {
|
||||
|
||||
var self = this;
|
||||
this.count = 0;
|
||||
this._me;
|
||||
this._engine;
|
||||
this._camera;
|
||||
this._repository;
|
||||
this._inputControlUnit;
|
||||
this._keyboardInput;
|
||||
}
|
||||
|
||||
Chuck.Processor.prototype.init = function() {
|
||||
|
||||
this._engine = new Chuck.Physics.Engine();
|
||||
this._me = new Chuck.Player(this._engine, this._repository);
|
||||
//this._camera = Camera.getInstance()
|
||||
//this._repository = Repository.getInstance();
|
||||
this._engine.setCollisionDetector(this._me);
|
||||
this._keyboardInput = new Chuck.Control.KeyboardInput();
|
||||
this._inputControlUnit = new Chuck.Control.InputControlUnit(this._keyboardInput, this._me);
|
||||
|
||||
new Chuck.Loader.Level(this._engine);
|
||||
//new Items();
|
||||
|
||||
this._me.spawn(100, 0);
|
||||
//this._camera.follow(this._me);
|
||||
|
||||
window.setInterval(this._update, 1000/60, this);
|
||||
//View.getInstance().getSprite().addEventListener(Event.ENTER_FRAME, this._update)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Chuck.Processor.prototype.getMe = function() {
|
||||
return this._me;
|
||||
}
|
||||
|
||||
Chuck.Processor.prototype.getEngine = function() {
|
||||
return this._engine;
|
||||
}
|
||||
|
||||
|
||||
Chuck.Processor.prototype._update = function(self) {
|
||||
self.count++;
|
||||
|
||||
self._engine.update();
|
||||
// Order is important
|
||||
|
||||
//self._repository.update();
|
||||
self._keyboardInput.update();
|
||||
self._me.update();
|
||||
//self._camera.update();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue