Class OrientedAnimation

java.lang.Object
ch.epfl.cs107.play.engine.actor.OrientedAnimation
All Implemented Interfaces:
Graphics, Updatable

public class OrientedAnimation extends Object implements Updatable, Graphics
  • Constructor Details

    • OrientedAnimation

      public OrientedAnimation(Animation[] animations, AreaEntity parent)
    • OrientedAnimation

      public OrientedAnimation(String name, int duration, AreaEntity parent, Vector anchor)
    • OrientedAnimation

      public OrientedAnimation(String name, int duration, AreaEntity parent, Vector anchor, Orientation[] order, int nbFrames, int width, int height, int regionWidth, int regionHeight, boolean repeat)
      Parameters:
      name - (String): the name of the image
      parent - (Positionable): parent of this, not null
      anchor - (Vector) : image anchor, not null
      order - (Orientation[]): order of the frames in the image
      nbFrames - (int): number of frames in each row
      width - (int): actual image width, before transformation
      height - (int): actual image height, before transformation
      regionWidth - (int): width of frame (number of pixels in the image)
      regionHeight - (int): height of frame (number of pixels in the image)
      repeat - (boolean : true if the animation must be repeated
    • OrientedAnimation

      public OrientedAnimation(String name, int duration, AreaEntity parent, Vector anchor, Orientation[] order, int nbFrames, int width, int height, int regionWidth, int regionHeight)
  • Method Details

    • update

      public void update(float deltaTime)
      Description copied from interface: Updatable
      Simulates a single time step. Note: Need to be Override
      Specified by:
      update in interface Updatable
      Parameters:
      deltaTime - elapsed time since last update, in seconds, non-negative
    • draw

      public void draw(Canvas canvas)
      Description copied from interface: Graphics
      Renders itself on specified canvas.
      Specified by:
      draw in interface Graphics
      Parameters:
      canvas - target, not null
    • reset

      public void reset()
    • orientate

      @Deprecated public void orientate(Orientation orientation)
      Deprecated.
    • isCompleted

      public boolean isCompleted()