Class PlatformFactory

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

public class PlatformFactory extends Object
Factory to create Platform entities.

Each Platform entity type should have a creation method that returns a corresponding entity.

  • Method Details

    • createStaticPlatform

      public static Entity createStaticPlatform()
      Creates a static platform entity.
      Returns:
      entity
    • createMovingPlatform

      public static Entity createMovingPlatform(com.badlogic.gdx.math.Vector2 offsetWorld, float speed)
      Creates a dynamic moving platform entity. Movement is based upon the calculation of offsetWorld.
      Parameters:
      offsetWorld - the world offset for the platform's movement
      speed - the speed at which the platform moves
      Returns:
      entity the created moving platform entity
    • createButtonTriggeredPlatform

      public static Entity createButtonTriggeredPlatform(com.badlogic.gdx.math.Vector2 offsetWorld, float speed)
      Creates button triggered platform, where if the player presses the button, the platform moves
      Parameters:
      offsetWorld -
      speed -
      Returns:
    • createVolatilePlatform

      public static Entity createVolatilePlatform(float lifetime, float respawnDelay)
      Creates volatile platform, where if the player stands on it for more than lifetime, the platform disappears. Platform respawns after respawnDelay.
      Parameters:
      lifetime -
      respawnDelay -
      Returns: