Ground support unit implementations

This commit is contained in:
Anuken
2020-07-10 12:14:24 -04:00
parent f39702e1cc
commit baa9f22a0b
35 changed files with 1267 additions and 1106 deletions

View File

@@ -90,7 +90,7 @@ public class PointDefenseTurret extends Block{
beamEffect.at(x + Tmp.v1.x, y + Tmp.v1.y, rotation, color, new Vec2().set(target));
shootEffect.at(x + Tmp.v1.x, y + Tmp.v1.y, rotation, color);
hitEffect.at(target.x(), target.y(), color);
hitEffect.at(target.x, target.y, color);
reload = reloadTime;
}
}else{

View File

@@ -101,14 +101,14 @@ public class Wall extends Block{
if(bullet.damage() > maxDamageDeflect) return true;
//translate bullet back to where it was upon collision
bullet.trns(-bullet.vel().x, -bullet.vel().y);
bullet.trns(-bullet.vel.x, -bullet.vel.y);
float penX = Math.abs(x - bullet.x()), penY = Math.abs(y - bullet.y());
float penX = Math.abs(x - bullet.x), penY = Math.abs(y - bullet.y);
if(penX > penY){
bullet.vel().x *= -1;
bullet.vel.x *= -1;
}else{
bullet.vel().y *= -1;
bullet.vel.y *= -1;
}
bullet.owner(this);