add lasers

This commit is contained in:
Asraelite 2016-03-30 19:15:06 +01:00
parent cf4e8024af
commit f87aa1446d
31 changed files with 298 additions and 125 deletions

View file

@ -121,6 +121,7 @@ class Body {
packFull() {
let packet = {
form: 'body',
type: this.type,
class: this.class,
id: this.id,
@ -140,6 +141,10 @@ class Body {
return {};
}
getWorldPos(pos) {
return this.b2body.GetWorldPoint(new b2Vec2(pos.x, pos.y), {});
}
get awake() {
if (this.b2body.IsAwake()) {
this.sleepTime = 0;