Hello,
I solved the challenge to stop Scarfy animating when in midair, however I didn’t nest my code into another If statement, I only added a logical AND operator plus a negation operator for ‘isInAir’. Is this good practice or is the idea for the challenge to show we can solve what we’re tasked as there could be multiple solutions?
if(runningTime >= updateTime && !isInAir)
{
runningTime = 0.0;
// update animation frame
scarfyRec.x = frame * scarfyRec.width;
frame++;
if(frame > 5)
{
frame = 0;
}
}