Random shoot sound pitch

This commit is contained in:
Anuken 2019-08-14 23:27:24 -04:00
parent cb2e2ab9b2
commit 2832dc69ef
4 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ public class SoundLoop{
private static final float fadeSpeed = 0.05f;
private final Sound sound;
private long id = -1;
private int id = -1;
private float volume, baseVolume;
public SoundLoop(Sound sound, float baseVolume){

View File

@ -92,7 +92,7 @@ public class Weapon{
float baseX = shooter.getX(), baseY = shooter.getY();
Weapon weapon = shooter.getWeapon();
weapon.shootSound.at(x, y);
weapon.shootSound.at(x, y, Mathf.random(0.8f, 1.0f));
sequenceNum = 0;
if(weapon.shotDelay > 0.01f){

View File

@ -54,7 +54,7 @@ public class BuildBlock extends Block{
Effects.effect(Fx.breakBlock, tile.drawx(), tile.drawy(), block.size);
world.removeBlock(tile);
Events.fire(new BlockBuildEndEvent(tile, team, true));
Sounds.breaks.at(tile);
Sounds.breaks.at(tile, Mathf.random(0.7f, 1.4f));
}
@Remote(called = Loc.server)
@ -75,7 +75,7 @@ public class BuildBlock extends Block{
Core.app.post(() -> tile.block().playerPlaced(tile));
}
Core.app.post(() -> Events.fire(new BlockBuildEndEvent(tile, team, false)));
Sounds.place.at(tile);
Sounds.place.at(tile, Mathf.random(0.7f, 1.4f));
}
@Override

View File

@ -279,7 +279,7 @@ public abstract class Turret extends Block{
Effects.effect(shootEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
Effects.effect(smokeEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
shootSound.at(tile);
shootSound.at(tile, Mathf.random(0.9f, 1.1f));
if(shootShake > 0){
Effects.shake(shootShake, shootShake, tile.entity);