Skip to content

Commit

Permalink
3.11.8
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Sep 6, 2023
1 parent 2c6ebdc commit d39652f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
39 changes: 22 additions & 17 deletions p5play.js
Original file line number Diff line number Diff line change
Expand Up @@ -6129,6 +6129,14 @@ p5.prototype.registerMethod('init', function p5playInit() {
},
set(val) {
_this._j['m_localAnchor' + l][axis] = (val / plScale) * _this['sprite' + l].tileSize;
if (_this.type == 'distance') {
_this._j.m_length = pl.Vec2.distance(
_this._j.m_bodyA.getWorldPoint(_this._j.m_localAnchorA),
_this._j.m_bodyB.getWorldPoint(_this._j.m_localAnchorB)
);
} else if (_this.type == 'hinge') {
_this._j.m_referenceAngle = _this._j.m_bodyB.getAngle() - _this._j.m_bodyA.getAngle();
}
}
});
}
Expand Down Expand Up @@ -8172,6 +8180,9 @@ main {
get arrowright() {
return this['arrowRight'];
}
get capslock() {
return this['capsLock'];
}
};

/**
Expand Down Expand Up @@ -8249,21 +8260,17 @@ main {
// which is more common for JavaScript properties
if (key.length > 1) {
key = key[0].toLowerCase() + key.slice(1);
} else {
let lower = key.toLowerCase();
let upper = key.toUpperCase();
if (key != upper) this.kb._pre(upper);
else this.kb._pre(lower);
}
this.kb._pre(key);

let k = simpleKeyControls[key];
if (k) this.kb._pre(k);

if (key == 'shift') {
for (let k in this.kb) {
if (this.kb[k] > 0 && k.length == 1) {
this.kb[k] = 0;
this.kb[k.toUpperCase()] = 2;
}
}
}

_onkeydown.call(this, e);
};

Expand All @@ -8276,20 +8283,18 @@ main {
}
if (key.length > 1) {
key = key[0].toLowerCase() + key.slice(1);
} else {
let lower = key.toLowerCase();
let upper = key.toUpperCase();
if (key != upper) this.kb._rel(upper);
else this.kb._rel(lower);
}
this.kb._rel(key);

let k = simpleKeyControls[key];
if (k) this.kb._rel(k);

if (key == 'shift') {
for (let k in this.kb) {
if (this.kb[k] > 0 && k.length == 1) {
this.kb[k] = 0;
this.kb[k.toLowerCase()] = 2;
}
}
} else if (e.shiftKey) {
if (e.shiftKey) {
// if user is pressing shift but released another key
let k = key.toLowerCase();
if (this.kb[k] > 0) this.kb._rel(k);
Expand Down
2 changes: 1 addition & 1 deletion p5play.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
"version": "git add -A",
"postversion": "git push"
},
"version": "3.11.7"
"version": "3.11.8"
}

0 comments on commit d39652f

Please sign in to comment.