Countdown - UQdeco2800/2022-studio-2 GitHub Wiki
The following page discusses the coding and design process for the countdown animation in sprint 3-4. The countdown animation goes over the UI bar and is used to visually represent the cool-down period immediately after using one of the skills in the skill-tree. The countdown time varies for different skills, but has been designed to go from a maximum of 20 to 1 over a period of 20 seconds.
Design
The number designs were inspired by the arcade-like game aesthetic. Consideration was put into making the numbers easily readable, as they will be put above the skill icons. Hence, they were designed in simple shapes and given a white border. Additionally, shadowing was used to add depth.
Code (Outdated)
The majority of the code logic for the count-down over UI bar is in Countdown.java.
The component is attached to the player entity and adds an overlay to the existing UI bar component, quickbar.java. This is done by creating a Table which is added to the "stage" component. When the same events that are used to trigger the ability animations on the character are triggered, event listeners in the Countdown class begin a timer, monitored by the update() method. The number of number images (represented as MAX_NUMBER) and the cool-down duration (represented as COUNTDOWN_DURATION_MILLIS) were set arbitrarily but will be fine-tuned in the final sprint.