-
Notifications
You must be signed in to change notification settings - Fork 9
Merge Powerups
atharvagupta2003 edited this page Oct 5, 2023
·
2 revisions
Merge Potions and Powerups to reduce Code duplication and accomodate it all in Laboratory
- Merging Potion Component, Potion Types and Potion factory into powerups
- Merging Config Files
- deleting all unwanted potion files
public class PowerupConfigs {
public PowerupConfig healthPowerup = new PowerupConfig();
public PowerupConfig speedPowerup = new PowerupConfig();
public PowerupConfig extraLifePowerup = new PowerupConfig();
public PowerupConfig doubleCrossPowerup = new PowerupConfig();
public PowerupConfig tempImmunityPowerup = new PowerupConfig();
public PowerupConfig doubleDamagePowerup = new PowerupConfig();
public PowerupConfig snapPowerup = new PowerupConfig();
public PowerupConfig death_potion = new PowerupConfig();
}
private void spawnPowerups() {
GridPoint2 minPos = new GridPoint2(0, 0);
GridPoint2 maxPos = terrain.getMapBounds(0).sub(2, 2);
GridPoint2 deathPosition = RandomUtils.random(minPos, maxPos);
// Create a health and speed powerup
Entity deathPotion = PowerupFactory.createDeathPotion();
// Spawn the created powerups at the two random locations
spawnEntityAt(deathPotion, deathPosition, true, false);
}
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files