Пример #1
0
        public GameEditorMenuItem(GameEditor pParent, GameEditorMenuItems pItemType, string szName)
        {
            Vector2 pPosition = new Vector2(130, 110 + ((int)pItemType) * 30);
            m_pKeys[Keys.D0] = "0";
            m_pKeys[Keys.D1] = "1";
            m_pKeys[Keys.D2] = "2";
            m_pKeys[Keys.D3] = "3";
            m_pKeys[Keys.D4] = "4";
            m_pKeys[Keys.D5] = "5";
            m_pKeys[Keys.D6] = "6";
            m_pKeys[Keys.D7] = "7";
            m_pKeys[Keys.D8] = "8";
            m_pKeys[Keys.D9] = "9";

            m_pKeys[Keys.NumPad0] = "0";
            m_pKeys[Keys.NumPad1] = "1";
            m_pKeys[Keys.NumPad2] = "2";
            m_pKeys[Keys.NumPad3] = "3";
            m_pKeys[Keys.NumPad4] = "4";
            m_pKeys[Keys.NumPad5] = "5";
            m_pKeys[Keys.NumPad6] = "6";
            m_pKeys[Keys.NumPad7] = "7";
            m_pKeys[Keys.NumPad8] = "8";
            m_pKeys[Keys.NumPad9] = "9";

            m_pKeys[Keys.OemPeriod] = ".";

            m_pParent = pParent;
            m_pItemType = pItemType;
            m_szName = szName;
            m_pPosition = pPosition;

            updateBoundingBox();
        }
Пример #2
0
        public GameEditorMenuTab(GameEditor pParent, string szName, int nItem)
        {
            m_nItemNumber = nItem;

            m_pParent = pParent;
            m_szName = szName;
            Vector2 pSize = m_pParent.Font.MeasureString(m_szName);

            int nPrevSize = 0;
            if(nItem != 0)
            {
                nPrevSize = (int)m_pParent.Tabs[nItem-1].getSize().X + 15;
            }

            int nY = 50;
            if (nItem >= 6)
            {
                nY = 80;
                nItem -= 6;
            }

            m_pPosition = new Vector2(100 + ( (nItem * 140)), nY);

            m_pBoundingBox = new Rectangle((int)m_pPosition.X, (int)m_pPosition.Y, (int)pSize.X, (int)pSize.Y);
        }
Пример #3
0
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager pContent)
        {
            m_pGameConfiguration = new GameConfiguration();
            m_pGameConfiguration.Load();

            m_pCamera = new Camera(this.Parent.GraphicsDevice);
            m_pCamera.Zoom = 3;

            m_pParticleEngine = new ParticleEngine(this);
            m_pParticleEngine.LoadContent(pContent);

            /*
            m_pParticleEngine.Emitter(new Vector2(0, 0), new Vector2(0, 0), Color.Blue, 10000, 500);
            m_pParticleEngine.ExplosionEmitter(new Vector2(0, -4), Color.Red, Color.Yellow, 500, 50);
            */
            m_pLevel = new Level(this);
            m_pLevel.LoadContent(pContent);

            m_pBulletManager = new BulletManager(this);
            m_pBulletManager.LoadContent(pContent);

            m_rgPlayers[0] = new Player(this, 1);
            if(this.Parent.Settings.TwoPlayers)
                m_rgPlayers[1] = new Player(this, 2);
            else
                m_rgPlayers[1] = new Player(this, 0);

            m_rgPlayers[0].LoadContent(pContent);
            m_rgPlayers[1].LoadContent(pContent);

            m_rgPlayers[0].PlayerIndex = Parent.Settings.PlayerOne;
            m_rgPlayers[1].PlayerIndex = Parent.Settings.PlayerTwo;
            m_rgPlayers[0].Speed = m_pGameConfiguration.PlayerSpeed;
            m_rgPlayers[1].Speed = m_pGameConfiguration.PlayerSpeed;

            m_pEnemyManager = new EnemyManager(this);
            m_pEnemyManager.LoadContent(pContent);
            //m_pEnemyManager.InitRandom();

            m_pFont = pContent.Load<SpriteFont>("GFX\\Fonts\\debugFont");

            m_pLightEffect = pContent.Load<Effect>("Effects\\lightEffect");
            m_pBlurEffect = pContent.Load<Effect>("Effects\\blurEffect");

            m_pLightEngine = new LightEngine(this);
            m_pLightEngine.LoadContent(pContent);

            m_pAnimationManager = new AnimationManager(this);
            m_pAnimationManager.LoadContent(pContent);

            m_pScrollerDisplay = new ScrollerDisplay.ScrollerDisplay();
            m_pScrollerDisplay.LoadContent(pContent);

            m_pGameRenderTarget = new RenderTarget2D(this.Parent.GraphicsDevice, this.Parent.GraphicsDevice.PresentationParameters.BackBufferWidth, this.Parent.GraphicsDevice.PresentationParameters.BackBufferHeight);
            m_pLightRenderTarget = new RenderTarget2D(this.Parent.GraphicsDevice, this.Parent.GraphicsDevice.PresentationParameters.BackBufferWidth, this.Parent.GraphicsDevice.PresentationParameters.BackBufferHeight);

            m_rgLevelItems[0] = new FlickeringLight(this);
            m_rgLevelItems[0].LoadContent(pContent);
            //m_rgLevelItems[1] = new FlickeringLight(this);

            m_pGameEditor = new GameEditor(this);
            m_pGameEditor.LoadContent(pContent);

            base.LoadContent(pContent);
        }