more sounds
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package io.anuke.mindustry.entities.bullet;
|
||||
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
import io.anuke.mindustry.entities.Effects.Effect;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.Effects.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
|
||||
//TODO scale velocity depending on fslope()
|
||||
public class ArtilleryBulletType extends BasicBulletType{
|
||||
@@ -15,6 +16,7 @@ public class ArtilleryBulletType extends BasicBulletType{
|
||||
collides = false;
|
||||
collidesAir = false;
|
||||
hitShake = 1f;
|
||||
hitSound = Sounds.explosion;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package io.anuke.mindustry.entities.bullet;
|
||||
|
||||
import io.anuke.mindustry.gen.*;
|
||||
|
||||
public class BombBulletType extends BasicBulletType{
|
||||
|
||||
public BombBulletType(float damage, float radius, String sprite){
|
||||
@@ -13,5 +15,6 @@ public class BombBulletType extends BasicBulletType{
|
||||
drag = 0.05f;
|
||||
keepVelocity = false;
|
||||
collidesAir = false;
|
||||
hitSound = Sounds.explosion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package io.anuke.mindustry.entities.bullet;
|
||||
|
||||
import io.anuke.arc.math.Angles;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.content.StatusEffects;
|
||||
import io.anuke.arc.audio.*;
|
||||
import io.anuke.arc.math.*;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.Effects.Effect;
|
||||
import io.anuke.mindustry.entities.effect.Lightning;
|
||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.graphics.Pal;
|
||||
import io.anuke.mindustry.type.ContentType;
|
||||
import io.anuke.mindustry.type.StatusEffect;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.entities.Effects.*;
|
||||
import io.anuke.mindustry.entities.effect.*;
|
||||
import io.anuke.mindustry.entities.traits.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.type.*;
|
||||
import io.anuke.mindustry.world.*;
|
||||
|
||||
public abstract class BulletType extends Content{
|
||||
public float lifetime;
|
||||
@@ -28,6 +27,8 @@ public abstract class BulletType extends Content{
|
||||
public Effect shootEffect = Fx.shootSmall;
|
||||
/** Extra smoke effect created when shooting. */
|
||||
public Effect smokeEffect = Fx.shootSmallSmoke;
|
||||
/** Sound made when hitting something or getting removed.*/
|
||||
public Sound hitSound = Sounds.none;
|
||||
/** Extra inaccuracy when firing. */
|
||||
public float inaccuracy = 0f;
|
||||
/** How many bullets get created per ammo item/liquid. */
|
||||
@@ -105,6 +106,7 @@ public abstract class BulletType extends Content{
|
||||
|
||||
public void hit(Bullet b, float x, float y){
|
||||
Effects.effect(hitEffect, x, y, b.rot());
|
||||
hitSound.at(b);
|
||||
|
||||
Effects.shake(hitShake, hitShake, b);
|
||||
|
||||
@@ -127,6 +129,7 @@ public abstract class BulletType extends Content{
|
||||
|
||||
public void despawned(Bullet b){
|
||||
Effects.effect(despawnEffect, b.x, b.y, b.rot());
|
||||
hitSound.at(b);
|
||||
|
||||
if(fragBullet != null || splashDamageRadius > 0){
|
||||
hit(b);
|
||||
|
||||
@@ -16,9 +16,8 @@ import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.traits.*;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.game.TypeID;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.Pal;
|
||||
import io.anuke.mindustry.input.Binding;
|
||||
import io.anuke.mindustry.input.InputHandler.PlaceDraw;
|
||||
@@ -71,6 +70,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
||||
private Tile mining;
|
||||
private Vector2 movement = new Vector2();
|
||||
private boolean moved;
|
||||
private SoundLoop sound = new SoundLoop(Sounds.thruster, 2f);
|
||||
|
||||
//endregion
|
||||
|
||||
@@ -110,6 +110,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
||||
dead = false;
|
||||
spawner = null;
|
||||
respawns --;
|
||||
Sounds.respawn.at(tile);
|
||||
|
||||
setNet(tile.drawx(), tile.drawy());
|
||||
clearItem();
|
||||
@@ -130,6 +131,11 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed(){
|
||||
sound.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float drag(){
|
||||
return mech.drag;
|
||||
@@ -507,6 +513,8 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
||||
destructTime = 0f;
|
||||
}
|
||||
|
||||
sound.update(x, y, isBoosting && !isDead() && !mech.flying);
|
||||
|
||||
if(isDead()){
|
||||
isBoosting = false;
|
||||
boostHeat = 0f;
|
||||
|
||||
Reference in New Issue
Block a user