-
Notifications
You must be signed in to change notification settings - Fork 3
Trap creation
A function that creates the trap in the game.
Traps are created and added to the map using Entity [nameOfTheTrap] = ObstacleFactory.createPhysicalTrap();
and using spawnEntityAt([nameOfTheTrap], [position], true, true);
to adjust the spawn location to [postion]
.
The trap's damage can be changed by adjusting x
in trap.getComponent(CombatStatsComponent.class).setBaseAttack(x);
To change the trap image copy the public static Entity createPhysicalTrap()
function in ObstacleFactory.java
and change the image path.
Trap placeholder can be found and replace at the image path (\source\core\assets\images). Placeholder upload commit
Dedicate hitbox trap layer has been added. The trap hitbox on the player is separated and the only slightly is bigger than the player collision box. It can resize in playerFactoy.java
To create traps which can be imported from the JSON, a variation to the currently traps was made in which there is no placeholder image (as textures are already on terrain) and that could be made of varying size.
The traps are created using the following code.
public static Entity createRSPhysicalTrap(float width, float height) {
Entity trap = new Entity()
.addComponent(new PhysicsComponent().setBodyType(BodyType.StaticBody))
.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE))
.addComponent(new CombatStatsComponent(1000000, 10))
.addComponent(new HitboxComponent().setLayer(PhysicsLayer.OBSTACLE))
.addComponent(new TouchAttackComponent(PhysicsLayer.TRAP, 4));
trap.setScale(width, height);
return trap;
}
(note in non-phycial traps .addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE))
is removed
where width and height are the size of the trap in world units.
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