fermions: after a block is affected by pilot wave it collides with intangible mobs, but not you
This commit is contained in:
landgreen
2021-05-17 05:52:37 -07:00
parent 14dfc4a145
commit cdf98c804a
5 changed files with 54 additions and 13 deletions

View File

@@ -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) {