2.2.2. Cycle 7
ar
Design
Objectives
Usability Features
Key Variables
Variable Name
Use
Pseudocode
procedure handlePlayerLizardCollision(lizard, faune){
dirx = faune.x - lizard.x
diry = faune.y - lizard.y
const newDir = vector(dirx, diry)
switch (healthState)
{
case HealthState.IDLE:
break
case HealthState.DAMAGE:
damageTime += dt
if (damageTime >= 250)
{
healthState = HealthState.IDLE
this.setTint(red)
this.damageTime = 0
}
}
if health <= 0
{
healthState = HealthState.DEAD
anims.play('faune-faint')
setVelocity(0, 0)
}
else
{
setVelocity(dir.x, dir.y)
setTint(normal)
healthState = HealthState.DAMAGE
this.damageTime = 0
}Development
Outcome
Challenges
Testing
Tests
Test
Instructions
What I expect
What actually happens
Pass/Fail
Tests
Test
Instructions
What I expect
What actually happens
Pass/Fail
Last updated