Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/Java/Microcraft/src/com/jdh/microcraft/entity/particle/EntityTextParticle.java
2022-09-04 12:45:01 +02:00

30 lines
982 B
Java

package com.jdh.microcraft.entity.particle;
import com.jdh.microcraft.Global;
import com.jdh.microcraft.gfx.Color;
import com.jdh.microcraft.gfx.Font;
import com.jdh.microcraft.level.Level;
public class EntityTextParticle extends EntityParticle {
private final String text;
private final int color;
public EntityTextParticle(Level level, int x, int y, String text, int color) {
super(level, x, y);
this.text = text;
this.color = color;
this.timeToLive = 30 + Global.random.nextInt(30);
}
public static void spawn(Level level, int x, int y, String text, int color) {
level.addEntity(new EntityTextParticle(level, x, y, text, color));
}
@Override
public void render() {
Global.random.setSeed(this.id);
Font.render(this.text, this.getRenderX() + 1, this.getRenderY() + 1, Color.add(this.color, -222));
Font.render(this.text, this.getRenderX(), this.getRenderY(), this.color);
}
}