2.2.3 Cycle 3 Adding Power

Design

In this cycle, I want to implement a power meter which displays the power of the shot. The up and down arrows will be used to increase and decrease the power accordingly.

Objectives

Usability features

Power increases/decreases exponentially

Key variables

Variable Name
Use

power

Stores the value for the power of the shot

smooth

A middle variable to help the power increase smoothly

Pseudocode

ifKeyDown("up") then
    smoothIncrease(power)
    
ifKeyDown("down") then
    smoothDecrease(power)
    
addUI(power)

Development

Outcome

The outcome of this cycle is a power meter displayed on the screen which can be adjusted by holding the up and down arrow keys.

Challenges

One of the challenges I encountered was making the power increase and decrease smoothly, as I had to use trial and error to find values to make it feel right.

Testing

Tests

Test
Instructions
What I expect
What actually happens
Pass/Fail

1

Run code

Kaboom should run

Kaboom ran normally

Pass

2

Tap up and down arrows

Power should increase/decrease slowly

Power increased and decreased slowly

Pass

3

Hold up and down arrows for a longer time

Power should gradually increase/decrease at an increasing rate

Power level increases and decreases as expected

Pass

4

Adjust power

UI should display the power and should be clamped between 0 and 100

UI works and power is locked between 0 and 100

Pass

Evidence

2MB
Open
The power level being adjusted in kaboom

Last updated