-
Notifications
You must be signed in to change notification settings - Fork 3
Boss teleportation
The elves boss has the special component (skill) that allow it to randomly teleport away from the player if its health is lower than 50%. The boss will spawn a vortex at its current position, then it will spawn another one at a random position on the map then it will teleport itself to that position.
The implementation of this feature also allowed the boss to spawn at a position outside of the map, and only teleport into the map once all other minions are killed.
@Override
public int getPriority() {
if ((ServiceLocator.getGameAreaService().getNumEnemy() == 0 && count == 0)
|| (ServiceLocator.getGameAreaService().getNumEnemy() != 0 && mapBound())) {
return 100;
}
if (canTeleport() || spawn) {
if (spawn && TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - lastFired >= 4000) {
spawn = false;
}
return 30;
}
return -1;
}
If all enemies are killed, the boss will spawn on the map, or if canTeleport() satisfy (boss lose health, health lower than 50%, and can see the player) then it will also teleport.
public void teleport() {
if (lastFired == 0) {
lastFired = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
}
spawn = true;
Entity entity = new Entity();
entity.setPosition(owner.getEntity().getPosition());
Entity vortex = WeaponFactory.createVortex(entity,
getDirectionOfTarget(), false);
Vector2 minPos =
new Vector2(0, 0);
Vector2 maxPos = new Vector2(10, 10);
pos2 = RandomUtils.random(minPos, maxPos);
Entity entity2 = new Entity();
entity2.setPosition(pos2);
gameArea.spawnEntityAt(vortex, owner.getEntity().getPosition(), true, true);
Entity vortex2 = WeaponFactory.createVortex(entity2, getDirectionOfTarget(), false);
gameArea.spawnEntityAt(vortex2, pos2, true, true);
}
Two vortices are created, one at the enemy position and one at the position it is teleport.
After 800ms (vortex upscale to desire size), the enemy will be teleport using
owner.getEntity().setPosition()
Design Document
- Story
- Music
-
Characters
- Main Character
- Bosses
-
Enemies
- Sprint 1: Final Design
-
Sprint 2: Elvish Boss
- Decision to make our boss a mage
- Design Inspiration: Staff Weapon
- Design decisions for boss
- Archery attack animation for minions
- Different types of minion elves and designs
- Melee attack animation
- Boss attack animation using sceptre
- Design Inspiration: Shooting fireballs
- Mage Boss attack method: fireball
- Sprint 3: Walk Animations and Design Amendments
- Sprint 4: Refining animations
- Map Design
- User + Play Testing
- Gameplay
- Art Style Design Guidelines
- Emotional Goals