Class BoxFactory
java.lang.Object
com.csse3200.game.entities.factories.BoxFactory
Factory class for creating box entities in the game.
Types of boxes that can be created include:
- white static (immovable)
- blue movable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder that creates autonomous (kinematic) box entities that can be used as moving game obstacles. -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityCreates a dynamic (moveable) box entity.static EntityCreates a dynamic box which has the ability to reflect laser beams.static EntityCreates a static (immovable) box entity.static EntityCreates a dynamic box which has a stronger gravity and can press down pressure plates
-
Method Details
-
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
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
-
createWeightedBox
Creates a dynamic box which has a stronger gravity and can press down pressure plates- Returns:
- a new moveable weighted box entity
-
createReflectorBox
Creates a dynamic box which has the ability to reflect laser beams.- Returns:
- a new moveable reflector box
-