Example #1
0
 private void SubscribeToEvents(SpawnWaves room)
 {
     room.onNewWave       += TriggerWaveStart;
     room.onWaveComplete  += TriggerWaveEnd;
     room.onBossRoomEnter += TriggerBossEnter;
     room.onBossDefeated  += TriggerBossDefeated;
 }
Example #2
0
 // spawn enemy bees
 static void StartWave(int wave)
 {
     SpawnZone[] zones = SpawnWaves.GetWave(wave);
     foreach (SpawnZone zone in zones)
     {
         Bee[] bList = beeSpawner.SpawnBees(zone);
         foreach (Bee bee in bList)
         {
             waveBees.Add(bee);
         }
     }
 }
Example #3
0
    private void Initialize()
    {
        RoomManager[] allRooms = FindObjectsOfType <RoomManager>();

        // Check for Level2 - Puzzle
        SpawnWaves p = FindObjectOfType <SpawnWaves>();

        if (p)
        {
            SubscribeToEvents(p);
        }

        // Otherwise, iterate through S1, S2, W, BR
        foreach (RoomManager r in allRooms)
        {
            SubscribeToEvents(r);
        }
    }
Example #4
0
    void Start()
    {
        // default components
        gameStatus           = new SaveGameStatus();
        displayText          = GetComponent <InGameDisplayText>();
        findPlayerController = GetComponent <FindControllers>();
        phase     = GetComponent <PhaseController>();
        player    = findPlayerController.FindPlayerController();
        challenge = GetComponent <ChallengeController>();
        cheat     = new PhaseCheater();

        // setting scores and others
        // gameStatus.SetGameDifficultToPlayerPrefs(3); - to tests
        gameStatus.GetGameDifficultToPlayerPrefs();
        phase.MultiplierNextPhase();
        GameOverFlag     = false;
        RestartFlag      = false;
        score            = 0;
        difficultCounter = 0;

        // setting start texts
        VerifyIfFirstGame();
        SetDisplayTexts();

        player.PlayerWait();

        // start the phase
        spawnWaves = new SpawnWaves();
        spawnWaves.GetGameControllerReference(this);

        startTheGame = new StartPhase();
        startTheGame.GetDisplayTextFromGameController(displayText);
        startTheGame.GetThePhaseFromGameController(phase);
        startTheGame.GetThePlayerFromGameController(player);

        StartCoroutine(startTheGame.StartTheGame(this));

        ContinueSpawnWaves = true;
        CanSpawnWaves();

        restart = new Restart(this, challenge);
        restart.GetDisplayTextFromGameController(displayText);
    }
Example #5
0
 void Awake()
 {
     spawn = this;
 }