-
Notifications
You must be signed in to change notification settings - Fork 9
Death Potion
atharvagupta2003 edited this page Oct 5, 2023
·
2 revisions
Appearance
Death Potion:
Creates mass enemy disposal effect.
Effect Implementation
Example:
case Death_Potion:
List<Entity> enemies = EnemyFactory.getEnemyList();
if (!enemies.isEmpty()) {
Random random = new Random();
int randomIndex = random.nextInt(enemies.size());
Entity enemy = enemies.get(randomIndex);
if (enemy != null) {
// Get the position of the selected enemy
pos = enemy.getPosition();
// Schedule a task to dispose of the enemy after 5 seconds
Timer.schedule(new Timer.Task() {
@Override
public void run() {
if (enemies.contains(enemy)) {
enemies.remove(enemy);
enemy.dispose();
}
}
}, 7f);
// Update the companion's position for tracking
this.trackPrev = entity.getPosition();
} else {
// No valid enemy found, use previous position
pos = this.trackPrev;
}
} else {
// No enemies available, use previous position
pos = this.trackPrev;
}
break;
default:
pos = new Vector2(0, 0);
break;
}
return pos;
Usage
- Activation: Press the 'B' key to toggle into attack mode and activate the "Death Potion" powerup.
- Effect: Upon activation, the "Death Potion" releases a deadly potion that targets and creates a mass enemy disposal.
Duration
- The effect of the "Death Potion" powerup is short-lived and lasts for a limited duration.
- After activation, the potion effect takes place and eliminates an enemy, after which the powerup is consumed.
Gameplay Impact
- Adds a strategic element to the game by allowing players to eliminate an enemy without direct engagement.
- Requires players to strategically time the use of this powerup to maximize its impact on the game.
Availability
- The "Death Potion" powerup can be spawned from laboratory.
- Companion can collect it by approaching the powerup.
Testing
- The "Death Potion" powerup has undergone testing to ensure that it functions correctly and enhances the gameplay experience as intended.
Integration
- Integrated into the game's Companion Weapon Controller, allowing players to interact with it seamlessly.
Vector2 movement = switch (this.weaponType) {
case Death_Potion -> update_swing();
case SHIELD -> update_static();
default -> null;
};
Future Iterations
- In future iterations of the game, additional visual and audio effects may be added to make the activation of the "Death Potion" powerup more engaging and immersive for the player.
Class Interaction
- Managed through the Powerup Component and interacts with Weapon Controller component to deliver its unique effect.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files