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 EntitycreateButtonTriggeredPlatform(com.badlogic.gdx.math.Vector2 offsetWorld, float speed) Creates button triggered platform, where if the player presses the button, the platform movesstatic EntitycreateMovingPlatform(com.badlogic.gdx.math.Vector2 offsetWorld, float speed) Creates a dynamic moving platform entity.static EntityCreates volatile platform that is linked to a pressure plate.static EntityCreates a static platform that also reflects lasers, using Tristyn's code from BoxFactory.createReflectorBox.static EntityCreates a static platform entity.static EntitycreateVolatilePlatform(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:
-
createReflectivePlatform
Creates a static platform that also reflects lasers, using Tristyn's code from BoxFactory.createReflectorBox.- Returns:
- the platform created
-
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:
-
createPressurePlatePlatform
Creates volatile platform that is linked to a pressure plate. When the pressure plate is pressed, the platform appears, and when it is released the platform is hidden.- Returns:
- pressure plate platform entity
-