mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-08-03 00:19:44 +07:00
Fixed RadialEffect + MultiEffect
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
package mindustry.entities.effect;
|
package mindustry.entities.effect;
|
||||||
|
|
||||||
|
import arc.graphics.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
@ -24,26 +25,14 @@ public class RadialEffect extends Effect{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void create(float x, float y, float rotation, Color color, Object data){
|
||||||
effect.init();
|
if(!shouldCreate()) return;
|
||||||
clip = Math.max(clip, effect.clip);
|
|
||||||
lifetime = effect.lifetime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
rotation += rotationOffset;
|
||||||
public void render(EffectContainer e){
|
|
||||||
float x = e.x, y = e.y;
|
|
||||||
|
|
||||||
e.rotation += rotationOffset;
|
|
||||||
|
|
||||||
for(int i = 0; i < amount; i++){
|
for(int i = 0; i < amount; i++){
|
||||||
e.x = x + Angles.trnsx(e.rotation, lengthOffset);
|
effect.create(x + Angles.trnsx(rotation, lengthOffset), y + Angles.trnsy(rotation, lengthOffset), rotation, color, data);
|
||||||
e.y = y + Angles.trnsy(e.rotation, lengthOffset);
|
rotation += rotationSpacing;
|
||||||
effect.render(e);
|
|
||||||
e.rotation += rotationSpacing;
|
|
||||||
e.id ++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clip = Math.max(clip, effect.clip);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user