initial commit

This commit is contained in:
logsol 2012-06-02 18:23:43 +02:00 committed by karl
parent c9d9ee2a70
commit 753b173fbc
13 changed files with 44688 additions and 0 deletions

66
lib/Game/Processor.js Executable file
View file

@ -0,0 +1,66 @@
Game.Processor = function() {
var self = this;
this.count = 0;
this._me;
this._engine;
this._camera;
this._repository;
this._inputControlUnit;
this._keyboardInput;
}
Game.Processor.prototype.init = function() {
this._engine = new Game.Physics.Engine();
/*
this._me = new Player();
this._camera = Camera.getInstance()
this._repository = Repository.getInstance();
this._engine.setCollisionDetector();
this._inputControlUnit = InputControlUnit.getInstance();
this._keyboardInput = KeyboardInput.getInstance();
new Level();
new Items();
*/
//Out.put("Players spawn after 3 seconds.");
//Out.put("Notice, that Player2 seems to be afk xD");
window.setInterval(this._update, 1000/60, this);
//View.getInstance().getSprite().addEventListener(Event.ENTER_FRAME, this._update)
}
Game.Processor.prototype.getMe = function() {
return this._me;
}
Game.Processor.prototype.getEngine = function() {
return this._engine;
}
Game.Processor.prototype._spawnPlayers = function(p1, p2) {
p1.spawn(50, 250);
this._camera.follow(p1);
}
Game.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();
*/
}