v5stable
Ondřej Hruška 11 years ago
parent 83f21ca8c5
commit d2276bee9c
  1. 4
      src/mightypork/rogue/world/entity/entities/PlayerEntity.java
  2. 2
      src/mightypork/rogue/world/entity/modules/EntityPos.java
  3. 10
      src/mightypork/rogue/world/entity/renderers/EntityRendererMobLR.java

@ -7,7 +7,7 @@ import mightypork.rogue.world.entity.EntityModel;
import mightypork.rogue.world.entity.EntityPathfindingContext;
import mightypork.rogue.world.entity.SimpleEntityPathFindingContext;
import mightypork.rogue.world.entity.renderers.EntityRenderer;
import mightypork.rogue.world.entity.renderers.SimpleLeftRightMobRenderer;
import mightypork.rogue.world.entity.renderers.EntityRendererMobLR;
import mightypork.rogue.world.level.Level;
import mightypork.rogue.world.level.render.MapRenderContext;
import mightypork.rogue.world.pathfinding.PathFindingContext;
@ -28,7 +28,7 @@ public class PlayerEntity extends Entity {
};
};
private final EntityRenderer renderer = new SimpleLeftRightMobRenderer(this, "sprite.player");
private final EntityRenderer renderer = new EntityRendererMobLR(this, "sprite.player");
public PlayerEntity(EntityModel model, int eid)

@ -19,7 +19,7 @@ import mightypork.util.timing.Updateable;
*
* @author MightyPork
*/
public class EntityPos implements IonBundled, Updateable {
class EntityPos implements IonBundled, Updateable {
private final Coord coord = new Coord(0, 0);
private final VectAnimated walkOffset = new VectAnimated(Vect.ZERO, Easing.LINEAR);

@ -12,12 +12,18 @@ import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.vect.Vect;
public class SimpleLeftRightMobRenderer extends EntityRenderer {
/**
* Renderer for a walking mob with only one strip (right sided), which is
* flipped for walking left.
*
* @author MightyPork
*/
public class EntityRendererMobLR extends EntityRenderer {
private final TxSheet sheet;
public SimpleLeftRightMobRenderer(Entity entity, String sheetKey)
public EntityRendererMobLR(Entity entity, String sheetKey)
{
super(entity);
this.sheet = Res.getTxSheet(sheetKey);
Loading…
Cancel
Save