prettier rat tail

v5stable
Ondřej Hruška 11 years ago
parent b07ff07688
commit 65efbe33da
  1. BIN
      res/img/dudes-b.png
  2. BIN
      res/img/dudes.png
  3. BIN
      res/img/dudes.xcf
  4. 3
      src/mightypork/rogue/Res.java
  5. 4
      src/mightypork/rogue/world/entity/Entity.java
  6. 6
      src/mightypork/rogue/world/entity/entities/PlayerEntity.java
  7. 2
      src/mightypork/rogue/world/entity/entities/RatEntity.java
  8. 2
      src/mightypork/rogue/world/entity/renderers/EntityRendererMobLR.java
  9. 2
      src/mightypork/rogue/world/gen/LevelGenerator.java
  10. 5
      src/mightypork/rogue/world/level/render/MapRenderContext.java

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

@ -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);
}
}

Loading…
Cancel
Save