Space Invaders (Part 31/34)

  • 3
  • Locked
Let's make the boss animate continuously. To do this, we need to give the setAnimatedView method an isLoopAnimation parameter responsible for indicating whether the animation should loop. This parameter is used to properly set the loopAnimation field. If the loopAnimation field is true, the nextFra
You can't complete this task, because you're not signed in.
Comments (3)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 31 , Greenfield, USA, United States
5 December 2021, 17:12
The nextFrame method in this section is an example of where the validation is too precise. In general, the following two blocks of code are equivalent:
if(condition)
{
    option 1
}
else
{
    option 2
}
if(!condition)
{
    option 2
}
else
{
    option 1
}
However the validator will only accept one of these two structures when it comes to the new code in the nextFrame method.
Seb
Level 41 , Crefeld, Germany
25 January 2020, 14:02
The given arguments for the last instruction (setting the Boss class's constructor) in part 31 are wrong. The provided arguments in the description are: true, ShapeMatrix.KILL_BOSS_ANIMATION_FIRST, ShapeMatrix.KILL_BOSS_ANIMATION_SECOND The correct arguments however are: true, ShapeMatrix.BOSS_ANIMATION_FIRST, ShapeMatrix.BOSS_ANIMATION_SECOND
Roman
Level 41
31 January 2020, 08:36
Thanks, we'll fix it soon.