mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Major progress on Planck.js migration - server starts without crashing
This commit is contained in:
parent
74957807e2
commit
875abd60d9
7 changed files with 64 additions and 54 deletions
|
|
@ -1,11 +1,11 @@
|
|||
define([
|
||||
"Lib/Vendor/Box2D",
|
||||
"Lib/Vendor/Planck",
|
||||
"Lib/Utilities/Exception",
|
||||
"Lib/Utilities/Assert",
|
||||
"Lib/Utilities/NotificationCenter"
|
||||
],
|
||||
|
||||
function (Box2D, Exception, Assert, nc) {
|
||||
function (planck, Exception, Assert, nc) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
@ -27,8 +27,8 @@ function (Box2D, Exception, Assert, nc) {
|
|||
|
||||
GameObject.prototype.destroy = function() {
|
||||
|
||||
if(this.body instanceof Box2D.Dynamics.b2Body) {
|
||||
this.body.GetWorld().DestroyBody(this.body);
|
||||
if(this.body) {
|
||||
this.body.getWorld().destroyBody(this.body);
|
||||
} else {
|
||||
throw new Exception("can not destroy body");
|
||||
}
|
||||
|
|
@ -40,8 +40,8 @@ function (Box2D, Exception, Assert, nc) {
|
|||
return this.body;
|
||||
};
|
||||
|
||||
GameObject.prototype.getPosition = function() {
|
||||
return this.body.GetPosition().Copy();
|
||||
GameObject.prototype.getPosition = function() {
|
||||
return this.body.getPosition().clone();
|
||||
};
|
||||
|
||||
GameObject.prototype.setUpdateData = function(update) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue