 // Phases
 ////////////////////////////////////////////////////////////
 
-#define PHASE_LOGO 1
-#define PHASE_GAME 2
-#define PHASE_GAMEOVER 3
+enum Phases
+{
+  PHASE_LOGO,
+  PHASE_GAME,
+  PHASE_NEXT_WAVE,
+  PHASE_GAMEOVER
+};
 uint8_t phase = PHASE_LOGO;
 
 ////////////////////////////////////////////////////////////

    sprite_render(&life, LIFE_X + (lifeWidth + 1) * i, LIFE_Y, buf, y, GREEN);

  // draw wave
  if (phase == PHASE_GAME)
  {
    sprite_render(&waveSprite, WAVE_X, WAVE_Y, buf, y, CYAN);
    render_digits(wave, 2, WAVE_X + 1 + sprite_width(&waveSprite), WAVE_Y, buf, y, WHITE);

      for (int i = 0 ; i < wave ; ++i)
        if (invaderType[i])
          haveInvaders = true;
      if (!haveInvaders && !waveInvaders && phase == PHASE_GAME)
      {
        phase = PHASE_NEXT_WAVE;
        ++wave;
        invaderType[wave - 1] = 0;
        waveInvaders = wave * 10;
        // Impossible mission
        if (wave == MAX_WAVE)
          waveInvaders = 9999;
        phaseTime = curTime;
      }
      
      // kill cannon
