mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-03 13:30:25 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
69462eb3f0
38
core/src/mindustry/entities/effect/SoundEffect.java
Normal file
38
core/src/mindustry/entities/effect/SoundEffect.java
Normal file
@ -0,0 +1,38 @@
|
||||
package mindustry.entities.effect;
|
||||
|
||||
import arc.*;
|
||||
import arc.audio.*;
|
||||
import arc.func.*;
|
||||
import arc.graphics.*;
|
||||
import arc.math.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
/** Plays a sound effect when created and simultaneously renders an effect. */
|
||||
public class SoundEffect extends Effect{
|
||||
public Sound sound = Sounds.none;
|
||||
public float minPitch = 0.8f;
|
||||
public float maxPitch = 1.2f;
|
||||
public float minVolume = 1f;
|
||||
public float maxVolume = 1f;
|
||||
public Effect effect;
|
||||
|
||||
public SoundEffect(){
|
||||
}
|
||||
|
||||
public SoundEffect(Sound sound, Effect effect){
|
||||
this.sound = sound;
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(float x, float y, float rotation, Color color, Object data){
|
||||
if(!shouldCreate()) return;
|
||||
|
||||
sound.at(x, y, Mathf.random(minPitch, maxPitch), Mathf.random(minVolume, maxVolume));
|
||||
effect.create(x, y, rotation, color, data);
|
||||
}
|
||||
}
|
@ -66,6 +66,7 @@ public class ClassMap{
|
||||
classes.put("ParticleEffect", mindustry.entities.effect.ParticleEffect.class);
|
||||
classes.put("RadialEffect", mindustry.entities.effect.RadialEffect.class);
|
||||
classes.put("SeqEffect", mindustry.entities.effect.SeqEffect.class);
|
||||
classes.put("SoundEffect", mindustry.entities.effect.SoundEffect.class);
|
||||
classes.put("WaveEffect", mindustry.entities.effect.WaveEffect.class);
|
||||
classes.put("WrapEffect", mindustry.entities.effect.WrapEffect.class);
|
||||
classes.put("DrawPart", mindustry.entities.part.DrawPart.class);
|
||||
|
@ -193,7 +193,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Realm of Serene Lime",
|
||||
"address": ["43.248.185.167:8517","n2.akiracloud.net:10686","n2.akiracloud.net:10486", "p12.simpfun.cn:8654"]
|
||||
"address": ["43.248.116.142:10627","n2.akiracloud.net:10686","n2.akiracloud.net:10486", "p12.simpfun.cn:8654"]
|
||||
},
|
||||
{
|
||||
"name": "CreateDustry",
|
||||
@ -233,8 +233,8 @@
|
||||
"address": ["118.127.8.162:25617", "78.108.218.117:25640", "srv3.godlike.club:27246"]
|
||||
},
|
||||
{
|
||||
"name": "Vanilla CroCraft",
|
||||
"address": ["130.61.175.47:6567", "41.216.188.223:5001"]
|
||||
"name": "CroCraft Network",
|
||||
"address": ["193.122.53.98:6567", "41.216.188.223:5001"]
|
||||
},
|
||||
{
|
||||
"name": "Extra Utilities",
|
||||
@ -258,6 +258,6 @@
|
||||
},
|
||||
{
|
||||
"name": "Atomic",
|
||||
"address": ["129.146.33.189:25709", "atomic-lab.ddns.net:30315"]
|
||||
"address": ["atomic-lab.ddns.net:25709", "atomic-lab.ddns.net:25907", "atomic-de.ddns.net:35845"]
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user