mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
Repaired Collision detecteion by adding one detector for each user - fixes #15
This commit is contained in:
parent
a1e94e1ed0
commit
f07505bc20
9 changed files with 31 additions and 29 deletions
|
|
@ -5,15 +5,11 @@ define([
|
|||
|
||||
function (Box2D, Parent) {
|
||||
|
||||
function Detector () {
|
||||
Parent.call(this);
|
||||
function Detector (player) {
|
||||
Parent.call(this, player);
|
||||
}
|
||||
|
||||
Detector.prototype = Object.create(Parent.prototype);
|
||||
|
||||
Detector.prototype.handleStand = function (point, isColliding) {
|
||||
throw "Implement this function";
|
||||
}
|
||||
|
||||
return Detector;
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
define([
|
||||
"Game/Core/GameController",
|
||||
"Game/Core/Physics/Engine",
|
||||
"Game/Core/Physics/Engine",
|
||||
"Game/Config/Settings",
|
||||
"Game/Server/Control/InputController",
|
||||
"Lib/Utilities/RequestAnimFrame",
|
||||
|
|
@ -61,6 +61,9 @@ function (Parent, PhysicsEngine, Settings, InputController, requestAnimFrame, No
|
|||
GameController.prototype.createPlayer = function(user) {
|
||||
var player = new Player(user.id, this.physicsEngine);
|
||||
player.setInputController(new InputController(player))
|
||||
|
||||
this.physicsEngine.setCollisionDetector(player);
|
||||
|
||||
return player;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue