public void OnChangeWave(EventManager EM, CustomArg e)
 {
     if (e.GetNumber() % 5 == 0 && count < 3)
     {
         count++;
         Spawn();
     }
 }
示例#2
0
    public void ChangeLevelEvent(int n)
    {
        CustomArg _myArg = new CustomArg(n);

        if (mChangeWaveEvent != null)
        {
            mChangeWaveEvent(this, _myArg);
        }
    }
示例#3
0
    /**
     * On light Touched flips the states of the bulbs given the bulb that has been touched.
     * Then checks if game has been won.
     */
    private void OnlightTouched(EventManager EM, CustomArg myArg)
    {
        int row = myArg.GetRow();
        int column = myArg.GetColumn();

        //flip the state of the bulb and the bulbs around it
         m_GameState.bulbIsOn[ row, column] = 	! m_GameState.bulbIsOn[ row, column];
        if( row > 0) m_GameState.bulbIsOn[ row - 1, column] = 	! m_GameState.bulbIsOn[ row - 1, column];
        if( row < 4) m_GameState.bulbIsOn[ row + 1, column] = 	! m_GameState.bulbIsOn[ row + 1, column];
        if( column > 0) m_GameState.bulbIsOn[ row, column - 1] = 	! m_GameState.bulbIsOn[ row, column - 1];
        if( column < 4) m_GameState.bulbIsOn[ row, column + 1] = 	! m_GameState.bulbIsOn[ row, column + 1];

        if( m_GameState.gameIsOn == true )
        {
            m_GameState.numOfTouches++;
            m_EventManager.RiseEventUpdateComponents();	//rise event to update lights and other things
            CheckforVictory();
        }
    }
示例#4
0
 /**
  * Rise Event Light Touched.
  * @param row and col.
  */
 public void RiseEventLightTouched( int row, int col)
 {
     CustomArg _myArg = new CustomArg( row, col);
         if( m_lightTouchedEvent != null ) m_lightTouchedEvent(this,_myArg);
 }
示例#5
0
 public void OnChangeWave(EventManager EM, CustomArg e)
 {
     damage += 2 * e.GetNumber();
 }
示例#6
0
 public void OnChangeWave(EventManager EM, CustomArg e)
 {
     count++;
     //Debug.Log("");
 }