2.7 Power up
Design
Objectives
set up power ups as well as a win loss system
Usability Features
Key Variables
Variable Name
Use
biggify
doubles the players size
smalify
returns the player back to normal
Pseudocode
Function big():
Initialize timer as 0
Initialize isBig as false
Return an object with the following methods and properties:
update():
If isBig is true:
Set CURRENT_JUMP_FORCE to BIG_JUMP_FORCE
Decrease timer by the time elapsed since the last frame (dt())
If timer is less than or equal to 0:
Call the smallify() method
isBig():
Return the value of isBig
smallify():
Set the scale of the object to (1, 1)
Set CURRENT_JUMP_FORCE to JUMP_FORCE
Reset timer to 0
Set isBig to false
biggify(time):
Set the scale of the object to (2, 2)
Set timer to the given "time" value
Set isBig to true
Development
Outcome
Challenges
setting a speed value that makes platforming smooth and movement feel responsive
Testing
Evidence for testing
Tests
Test
Instructions
What I expect
What actually happens
Pass/Fail
1
Interact with star
the player is twice as large
As expected
Pass
Evidence

Last updated