Class BoxFactory

java.lang.Object
com.csse3200.game.entities.factories.BoxFactory

public class BoxFactory extends Object
Factory class for creating box entities in the game.

Types of boxes that can be created include:
- white static (immovable)
- blue movable

  • Method Details

    • createStaticBox

      public static Entity createStaticBox()
      Creates a static (immovable) box entity.

      The box currently displays as a white square, scaled to half a game unit.

      Its static body type makes it immovable. Other physical game objects can collide with it, but it does not move, react to collisions and cannot be destroyed.

      Returns:
      A new static box Entity
    • createMoveableBox

      public static Entity createMoveableBox()
      Creates a dynamic (moveable) box entity.

      The box currently displays as a blue square, scaled to half a game unit.

      Its dynamic body type makes it moveable. The player can automatically push the box with its body, or interact with the box to lift it or drop it. The player can move with the box whilst it is lifted.

      Returns:
      A new moveable box Entity