prettier rat tail
This commit is contained in:
@@ -76,9 +76,10 @@ public final class Res {
|
||||
textures.addQuad("panel", gui.makeQuad(0, 3.75, 4, .25));
|
||||
|
||||
// sprites
|
||||
texture = textures.loadTexture("mob", "/res/img/dudes-b.png", FilterMode.NEAREST, WrapMode.CLAMP);
|
||||
texture = textures.loadTexture("mob", "/res/img/dudes.png", FilterMode.NEAREST, WrapMode.CLAMP);
|
||||
tiles = texture.grid(8, 8);
|
||||
textures.addSheet("sprite.player", tiles.makeSheet(0, 0, 4, 1));
|
||||
textures.addSheet("sprite.rat", tiles.makeSheet(0, 1, 4, 1));
|
||||
|
||||
// small sheet
|
||||
texture = textures.loadTexture("tiles", "/res/img/tiles16.png", FilterMode.NEAREST, WrapMode.CLAMP);
|
||||
|
||||
@@ -151,7 +151,9 @@ public abstract class Entity implements IonObjBundled, Updateable {
|
||||
@DefaultImpl
|
||||
public final void render(MapRenderContext context)
|
||||
{
|
||||
getRenderer().render(context);
|
||||
if (context.getTile(getCoord()).isExplored()) {
|
||||
getRenderer().render(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -116,4 +116,10 @@ public class PlayerEntity extends Entity {
|
||||
{
|
||||
return EntityType.PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveAttack(Entity attacker, int attackStrength)
|
||||
{
|
||||
// FIXME ignore attack
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class RatEntity extends Entity {
|
||||
protected EntityRenderer getRenderer()
|
||||
{
|
||||
if (renderer == null) {
|
||||
renderer = new EntityRendererMobLR(this, "sprite.player");
|
||||
renderer = new EntityRendererMobLR(this, "sprite.rat");
|
||||
}
|
||||
|
||||
return renderer;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class EntityRendererMobLR extends EntityRenderer {
|
||||
final Vect visualPos = entity.pos.getVisualPos();
|
||||
|
||||
Rect spriteRect = Rect.make(visualPos.x() * w, visualPos.y() * w, w, w);
|
||||
spriteRect = spriteRect.shrink(w * 0.1);
|
||||
spriteRect = spriteRect.shrink(w * 0.05);
|
||||
|
||||
Render.quadTextured(spriteRect, q);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class LevelGenerator {
|
||||
// spawn rats
|
||||
|
||||
final Coord pos = Coord.make(0, 0);
|
||||
for (int i = 0; i < 1; i++) { // 4+complexity + rand.nextInt(1+complexity)
|
||||
for (int i = 0; i < 4+complexity + rand.nextInt(1+complexity); i++) {
|
||||
|
||||
final Entity e = Entities.RAT.createEntity(world);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import mightypork.gamecore.util.math.algo.Coord;
|
||||
import mightypork.gamecore.util.math.constraints.rect.Rect;
|
||||
import mightypork.gamecore.util.math.constraints.rect.builders.TiledRect;
|
||||
import mightypork.rogue.world.level.MapAccess;
|
||||
import mightypork.rogue.world.tile.Tile;
|
||||
|
||||
|
||||
public abstract class MapRenderContext {
|
||||
@@ -33,4 +34,8 @@ public abstract class MapRenderContext {
|
||||
{
|
||||
return mapRect;
|
||||
}
|
||||
|
||||
public Tile getTile(Coord pos) {
|
||||
return map.getTile(pos);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user