grenadier collision fix

This commit is contained in:
landgreen
2021-07-06 06:58:31 -07:00
parent b0b8e09333
commit 9da29484a0
3 changed files with 9 additions and 12 deletions

View File

@@ -2249,7 +2249,7 @@ const level = {
// spawn.pulsarBoss(1900, -500) // spawn.pulsarBoss(1900, -500)
spawn.grenadierBoss(1900, -500) spawn.grenadierBoss(1900, -500)
spawn.shieldingBoss(1900, -500) // spawn.shieldingBoss(1900, -500)
// spawn.historyBoss(1200, -500) // spawn.historyBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400) // spawn.laserTargetingBoss(1600, -400)
// spawn.hopper(1600, -500) // spawn.hopper(1600, -500)
@@ -2263,7 +2263,7 @@ const level = {
// spawn.laser(1200, -500) // spawn.laser(1200, -500)
// spawn.shield(mob[mob.length - 1], 1800, -120, 1); // spawn.shield(mob[mob.length - 1], 1800, -120, 1);
// spawn.nodeGroup(1200, -500, "grenadier") spawn.nodeGroup(1200, -500, "grenadier")
// spawn.snakeBoss(1200, -500) // spawn.snakeBoss(1200, -500)
// spawn.suckerBoss(2900, -500) // spawn.suckerBoss(2900, -500)
// spawn.randomMob(1600, -500) // spawn.randomMob(1600, -500)
@@ -3921,7 +3921,7 @@ const level = {
powerUps.spawn(-4200, -700, "ammo"); powerUps.spawn(-4200, -700, "ammo");
powerUps.spawn(-4000, -700, "ammo"); powerUps.spawn(-4000, -700, "ammo");
spawn.mapRect(-4450, -1000, 100, 500); spawn.mapRect(-4450, -1000, 100, 500);
spawn.bodyRect(-3576, -750, 150, 150); spawn.bodyRect(-3500, -750, 150, 150);
//building 1 //building 1
spawn.bodyRect(-1000, -675, 25, 25); spawn.bodyRect(-1000, -675, 25, 25);

View File

@@ -3017,8 +3017,8 @@ const spawn = {
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
spawn.grenade(this.position.x, this.position.y, 2, 4, 75 * simulation.CDScale); spawn.grenade(this.position.x, this.position.y, 2, 4, 75 * simulation.CDScale);
const who = mob[mob.length - 1] const who = mob[mob.length - 1]
who.collisionFilter.category = 0 // who.collisionFilter.category = 0
who.collisionFilter.mask = 0 who.collisionFilter.mask = cat.player | cat.map;
const speed = 4 * simulation.accelScale; const speed = 4 * simulation.accelScale;
const angle = 2 * Math.PI * i / 6 const angle = 2 * Math.PI * i / 6
Matter.Body.setVelocity(who, { Matter.Body.setVelocity(who, {
@@ -3034,8 +3034,8 @@ const spawn = {
this.grenadeLimiter += 60 this.grenadeLimiter += 60
spawn.grenade(this.position.x, this.position.y, 2, 4, 80 + Math.floor(60 * Math.random())); spawn.grenade(this.position.x, this.position.y, 2, 4, 80 + Math.floor(60 * Math.random()));
const who = mob[mob.length - 1] const who = mob[mob.length - 1]
who.collisionFilter.category = 0 // who.collisionFilter.category = 0
who.collisionFilter.mask = 0 who.collisionFilter.mask = cat.player | cat.map;
const velocity = Vector.mult(Vector.normalise(Vector.sub(player.position, who.position)), 3 * Math.sqrt(simulation.accelScale) + 4 * Math.random()) const velocity = Vector.mult(Vector.normalise(Vector.sub(player.position, who.position)), 3 * Math.sqrt(simulation.accelScale) + 4 * Math.random())
Matter.Body.setVelocity(who, { Matter.Body.setVelocity(who, {
x: this.velocity.x + velocity.x, x: this.velocity.x + velocity.x,
@@ -3174,8 +3174,8 @@ const spawn = {
}; };
me.onDeath = function() { //helps collisions functions work better after vertex have been changed me.onDeath = function() { //helps collisions functions work better after vertex have been changed
spawn.grenade(this.position.x, this.position.y, 2, 4, 75 * simulation.CDScale); spawn.grenade(this.position.x, this.position.y, 2, 4, 75 * simulation.CDScale);
mob[mob.length - 1].collisionFilter.category = 0 // mob[mob.length - 1].collisionFilter.category = 0
mob[mob.length - 1].collisionFilter.mask = 0 mob[mob.length - 1].collisionFilter.mask = cat.player | cat.map;
} }
// spawn.shield(me, x, y); // spawn.shield(me, x, y);
me.do = function() { me.do = function() {

View File

@@ -1,8 +1,5 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
new mobs - grenadier and grenadierBoss
tech drone repair has a 25% chance to use ammo, was 33%
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************