fermions
fermions: after a block is affected by pilot wave it collides with intangible mobs, but not you
This commit is contained in:
19
js/player.js
19
js/player.js
@@ -2321,6 +2321,7 @@ const m = {
|
||||
const unit = Vector.mult(Vector.normalise(sub), body[i].mass * tech.pilotForce * Vector.magnitude(sub))
|
||||
body[i].force.x += unit.x
|
||||
body[i].force.y += unit.y - body[i].mass * simulation.g //remove gravity effects
|
||||
if (tech.isBlockBullets && body[i].collisionFilter.category !== cat.bullet) body[i].collisionFilter.category = cat.bullet;
|
||||
} else {
|
||||
m.fieldCDcycle = m.cycle + 120;
|
||||
m.fieldOn = false
|
||||
@@ -2330,6 +2331,24 @@ const m = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// m.holdingTarget.collisionFilter.category = cat.bullet;
|
||||
// m.holdingTarget.collisionFilter.mask = cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet | cat.mobShield;
|
||||
// //check every second to see if player is away from thrown body, and make solid
|
||||
// const solid = function(that) {
|
||||
// const dx = that.position.x - player.position.x;
|
||||
// const dy = that.position.y - player.position.y;
|
||||
// if (that.speed < 3 && dx * dx + dy * dy > 10000 && that !== m.holdingTarget) {
|
||||
// that.collisionFilter.category = cat.body; //make solid
|
||||
// that.collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet; //can hit player now
|
||||
// } else {
|
||||
// setTimeout(solid, 40, that);
|
||||
// }
|
||||
// };
|
||||
// setTimeout(solid, 200, m.holdingTarget);
|
||||
|
||||
|
||||
|
||||
if (tech.isFreezeMobs) {
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
if (Vector.magnitude(Vector.sub(mob[i].position, m.fieldPosition)) < m.fieldRadius) {
|
||||
|
||||
Reference in New Issue
Block a user