Sound stuff (#4332)

This commit is contained in:
MEEP of Faith 2021-01-15 07:13:41 -08:00 committed by GitHub
parent 593a7b060c
commit 956f4659c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,10 @@ public abstract class BulletType extends Content{
public Effect smokeEffect = Fx.shootSmallSmoke;
/** Sound made when hitting something or getting removed.*/
public Sound hitSound = Sounds.none;
/** Pitch of the sound made when hitting something*/
public float hitSoundPitch = 1;
/** Volume of the sound made when hitting something*/
public float hitSoundVolume = 1;
/** Extra inaccuracy when firing. */
public float inaccuracy = 0f;
/** How many bullets get created per ammo item/liquid. */
@ -186,7 +190,7 @@ public abstract class BulletType extends Content{
public void hit(Bullet b, float x, float y){
hitEffect.at(x, y, b.rotation(), hitColor);
hitSound.at(b);
hitSound.at(x, y, hitSoundPitch, hitSoundVolume);
Effect.shake(hitShake, hitShake, b);