Class PlatformFactory
java.lang.Object
com.csse3200.game.entities.factories.PlatformFactory
Factory to create Platform entities.
Each Platform entity type should have a creation method that returns a corresponding entity.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createButtonTriggeredPlatform
(com.badlogic.gdx.math.Vector2 offsetWorld, float speed) Creates button triggered platform, where if the player presses the button, the platform movesstatic Entity
createMovingPlatform
(com.badlogic.gdx.math.Vector2 offsetWorld, float speed) Creates a dynamic moving platform entity.static Entity
Creates a static platform entity.static Entity
createVolatilePlatform
(float lifetime, float respawnDelay) Creates volatile platform, where if the player stands on it for more than lifetime, the platform disappears.
-
Method Details
-
createStaticPlatform
Creates a static platform entity.- Returns:
- entity
-
createMovingPlatform
Creates a dynamic moving platform entity. Movement is based upon the calculation of offsetWorld.- Parameters:
offsetWorld
- the world offset for the platform's movementspeed
- 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
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:
-