Archived
Private
Public Access
1
0

Initial commit

This commit is contained in:
2022-09-04 12:45:01 +02:00
commit f4a01d6a69
11601 changed files with 4206660 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
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);
}
}