Class InanimateFloor

All Implemented Interfaces:
Collidable

public class InanimateFloor extends Inanimate
The standard Inanimate that will be used for the lowest height in the level. By mechanics, it does not differ from the InanimateBox but is instead designed to resemble grass.
Author:
Angelo Aracri
  • Constructor Details

    • InanimateFloor

      protected InanimateFloor(Vec pos, Vec size)

      Standard constructor that requires position and size of the InanimateFloor.

      Also, it creates the GrassStraws that will be rendered on top of the InanimateFloor.

      Parameters:
      pos - the position of the InanimateFloor.
      size - the size of the InanimateFloor.
  • Method Details

    • internalRender

      public void internalRender(GameGrid f)
      Description copied from class: GameElement

      Template method that will be called periodically after being added to a IScene. Must be as performant as possible to keep the FPS low, since it will be called in every render-loop.

      Should be overwritten in sub classes for custom visualization using the GameGrid.

      Overrides:
      internalRender in class Inanimate
      Parameters:
      f - the GameGrid that represents the games field and supplies primitive drawing operations.
    • reactToCollision

      public void reactToCollision(GameElement element, Direction dir)
      Description copied from interface: Collidable

      Notification that this GameElement has been collided with from another GameElement element from the given direction dir.

      Can be overwritten for defining an optional reaction that the GameElement performs on the other GameElement and/or itself upon collision.

      Specified by:
      reactToCollision in interface Collidable
      Overrides:
      reactToCollision in class Inanimate
      Parameters:
      element - the GameElement that collided with this GameElement
      dir - the Direction this GameElement has been collided from.
    • staticCreate

      public static Inanimate staticCreate(Vec pos)
      Static create method that will be used by Inanimate for it in order to decide between InanimateFloor and InanimateBox.
      Parameters:
      pos - the position to create the InanimateFloor to.
      Returns:
      the newly created InanimateFloor.