-
Notifications
You must be signed in to change notification settings - Fork 1
Usable Items key methods
- BearTrap.java
spawnBearTrap(Entity entity)
: Spawns a bear trap entity at the player's current position using the DeployableItemFactory.
getName()
: Returns the name of the bear trap item as a string ("Bear Trap").
getIcon()
: Provides the texture for the bear trap's icon, used in the inventory or UI.
getItemSpecification()
: Returns the specification identifier ("beartrap") for the bear trap item.
apply(Entity entity)
: Applies the bear trap to an entity by calling spawnBearTrap()
to deploy the trap in the game world.
- TrapComponent.java
create()
: Registers the event listener for detecting collisions when the trap is initialized.
onCollisionStart(Fixture me, Fixture other)
: Handles collision events, applies damage to enemies, immobilizes them, and removes the trap after use.
isEnemy(Entity enemy)
: Determines if the colliding entity is an enemy (non-pet) by checking for specific AI task configurations.
markEntityForRemoval(Entity trap)
: Marks the trap entity for removal from the game after it has been used.
immobilizeEnemies(Entity enemy)
: Stops the tasks of the enemy entity and then restarts them after a set time (5 seconds) to simulate immobilization.
- Increases the player's health by a large boost of 100 and caps it at player's current maximum health when required.
- Uses
setHealth()
inCombatStatsComponent.java
to update health.
- Increases the player's health by a small health boost of 20 and caps it at 100 when required.
- Uses
setHealth()
inCombatStatsComponent.java
to update health.
- Gives an instant boost of 50 to player and it does not care about the capping.
- It uses
addHealth()
inCombatStatsComponent.java
to increase health
- Provides temporary immunity by negating the next two hits.
- This item's
effect()
instantly kills all enemies in the current room.
- This item's
effect()
allows the player to instantly teleport to the boss room bypassing all other rooms
- Gasoline.java
spawnRingFire(Entity entity)
: Spawns a ring of fire around the player's current position using the DeployableItemFactory.
getName()
: Returns the name of the item as a string ("Gasoline").
getItemSpecification()
: Returns the specification identifier ("gasoline").
apply(Entity entity)
: Spawns 12 different instances of the fire to form a ring.
- The reroll item is created using...
CollectibleFactory collectibleFactory = new CollectibleFactory()
Entity collectible = collectibleFactory.createCollectibleEntity("item:reroll")
//Creates a usable reroll item
- Reroll.java: The class for a reroll item
-
ItemPickupComponent.java: Contains a method
handleReroll()
that handles the reroll item effect. It spawns another item in place of the other item in collision. The random newly spawned item is handled in therandomItemGenerator()
method of this class.
- Key presses: Unlike most UsableItems, the reroll item is "used" by pressing "R" when in collision with another item
This item is currently only tested manually.
- Use
createCollectibleEntity(String specification)
method in CollectibleFactory.java. This method then creates a Collectible instance of an item based on the specification using thecreate()
method of this class. If the string specifies an "item" or "buff", thecreate()
method of the ItemFactory is called (see below for 'Creating a collectible item')
- After the Collectible instance is obtained, the second
createCollectibleEntity(String specification, Collectible collectible)
method is called, which returns the Entity of this collectible item. This method also checks for "mystery" in the specification. If this is the case, then the TextureRenderComponent has the mystery box icon associated with that collectible and is otherwise the collectible icon. This method also checks for "buyable" in the specification. If this is the case, then it adds a BuyableComponent to this entity, with a default cost of 10.
- Uses
create()
method in ItemFactory.java. This method checks that the item type specification is correct. It then calls upon theloadCreators()
method of this class to create the items based on the specification.
Design Choices
Utilities
Animals
Menus/screens
Character
- Character Animations
- Character's Inventory On Display
- Character's Inventory System
- Character's HealthBar
- Character's Interaction with Items
- Character achievements
- Saving Character
- Player-(and-other-NPC)-invincibility-frames
- Player Factory
- Scoring System
- Test Plan for Inventory System
- Test Plan for Player's Interaction with Items
- Test Plan for Player's Inventory Display
- Test Plan for Saving Character State
- Test Plan for Scoring System
Map
Weapon
- Weapon Overview
- Weapon Types
- Weapon Structure
- Weapon Stats Display
- Testing Plan for Weapon Factory
- Testing Plan for Firing Controller Component
- Testing Plan for Position Tracker Component
- Testing Plan for Weapon Animation Controller component
- Testing Plan for Concrete Melee Weapon class
- Testing Plan for Concrete Ranged Weapon class