-
Notifications
You must be signed in to change notification settings - Fork 3
Camera Tracking
The view of the game will be centred around the main character to allow the player to follow them around the map. This feature will allow the map to be more interesting with the layout design as well as hiding the entire layout from the player while they are traversing it. Tracking the character allows for a closer view on the main character while they are attacking enemies and using abilities instead of a very zoomed out alternative displaying the entire map.
Dynamically changing the zoom of the camera based on room sizes and other in game factors has been considered.
To track the main character, the entity of the character needs to be stored within the camera component to allow the character's position, relative to the map, to be used to set the camera position. Whenever the camera position would update, it would be based on position of the character but this felt stiff and would often cause stuttering when the player would sprint and use dashes.
To fix this issue, the average of the last 50 positions was calculated and used as the camera position. This allows for the camera to quickly catch up to the player after using a dash while not following the player at the same speed, causing stuttering. The effect that this has allows for very smooth camera transitions to where the player is moving yet feels responsive enough such that nothing is ever out of view.
Private Attributes
-
player
: The entity of the player the camera is focused on. -
lastPositions
: An array of up to the last 50 Vector2.
Public Methods
-
update()
: This method previously was tracking the position of the camera and not the character. Changes to this use the character's position to centre the camera. -
setPlayer(Entity player)
: This method is used to store the instance of the player the camera will track.
Private Methods
-
calculatePositions
: This method calculates the average of the last positions of the camera and returns them in the form of a Vector2.
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