Example #1
0
        /// <summary>
        /// Create game's graphical interface.
        /// </summary>
        private void CreateGUI()
        {
            //If player
            if (m_Player == Player.Klotski || m_Player == Player.Storm) {
                //Create lifebar
                m_LifeBar		= new LifeBar(Global.GUIManager);
                m_LifeBar.Left	= Global.LIFEBAR_X;
                m_LifeBar.Top	= Global.LIFEBAR_Y;
                m_LifeBar.Init();

                //Add it
                m_Panel.Add(m_LifeBar);
                Global.GUIManager.Add(m_LifeBar);
            }

            //If not editor
            if (m_Player != Player.Storm) {
                //Create timer
                m_Timer			= new Timer(Global.GUIManager);
                m_Timer.Left	= Global.TIMER_X;
                m_Timer.Top		= Global.TIMER_Y;
                m_Timer.Init(Global.TIMER_FONT);

                //Create steps counter
                m_Counter		= new Counter(Global.GUIManager);
                m_Counter.Left	= Global.COUNTER_X;
                m_Counter.Top	= Global.COUNTER_Y;
                m_Counter.Init(Global.COUNTER_FONT, m_Player != Player.Klotski);

                //Add it
                m_Panel.Add(m_Timer);
                m_Panel.Add(m_Counter);
                Global.GUIManager.Add(m_Timer);
                Global.GUIManager.Add(m_Counter);

            }
        }
Example #2
0
        /// <summary>
        /// State Game class constructor.
        /// </summary>
        public StateGame(Player player, GameData data)
            : base(StateID.Game)
        {
            //Initialize variable
            m_Data			= data;
            m_Player		= player;
            m_Victory		= false;
            m_Initialized	= false;
            m_ReadyToUpdate	= false;
            m_BoardWidth    = 0;
            m_BoardHeight   = 0;
            m_IteratorStack	= new Stack<int>();
            m_ShipStack		= new Stack<Ship>();
            m_VisitedList	= new List<GameData>();

            //Empties variables
            m_Depth			= 0;
            m_MaxDepth		= 0;
            m_Sky			= null;
            m_Actor			= null;
            m_King			= null;
            m_Ships			= null;
            m_Board			= null;
            m_SkyLayer		= null;
            m_BirdsView		= null;
            m_ActiveCamera	= null;
            m_Controlled	= null;
            m_LifeBar		= null;
            m_Timer			= null;
        }