示例#1
0
        /// <summary>
        /// Default Constructor for the player class.
        /// </summary>
        public Player()
            : base()
        {
            m_playerSprite = AIE.GameStateManager.Game.Content.Load<Texture2D>("Images/playerNoGlow");
            m_playerGlowSprite = AIE.GameStateManager.Game.Content.Load<Texture2D>("Images/playerGlow");
            m_crosshairSprite = AIE.GameStateManager.Game.Content.Load<Texture2D>("Images/RoundCrosshair");
            
            m_shootingSound = AIE.GameStateManager.Game.Content.Load<SoundEffect>("Sounds/Laser007");
            m_shootingSoundInstanceList = new List<SoundEffectInstance>();

            m_options = new OptionsObject();

            m_shootingVolume = 0.05f;

            m_playerColour = Color.White;

            for (int i = 0; i < 15; i++)
            {
                m_shootingSoundInstanceList.Add(m_shootingSound.CreateInstance());
                m_shootingSoundInstanceList[i].Volume = m_shootingVolume * Globals.m_volume;
            }

            m_shootingSoundCooldown = 0.1f;

            m_facingDirection = new Vector2(0, -1);
            m_shootingDirection = new Vector2(0, -1);
            m_position = new Vector2(630, 630);
            m_crosshairPosition = Globals.m_mousePosition;
            m_textureScale = 0.35f;            
            m_dimensions = new Vector2(64, 64) * m_textureScale;
            m_origin = new Vector2(m_dimensions.X / 2.0f, m_dimensions.Y / 2.0f) / m_textureScale;
            m_playerSource = new Rectangle(0, 0, (int)(m_dimensions.X / m_textureScale), (int)(m_dimensions.Y / m_textureScale));
            m_speed = 300.0f;

            m_bulletList = new List<Bullet>();
            m_loadedOptions = false;

            m_collisionCircle = new Circle(m_position, m_origin.X * m_textureScale);

            m_rotationAngle = 0.0f;
            m_shootingAngle = 0.0f;
            m_shootCooldown = 0.1f;
            m_decelerationTime = 0.0f;

            m_powerupMultifire = false;
            m_powerupMultifireCD = 0.0f;

        }
示例#2
0
        public Game1()
            : base()
        {
            #region GRAPHICS AND CONTENT
            graphics = new GraphicsDeviceManager(this);

            this.graphics.PreferredBackBufferHeight = 544;
            this.graphics.PreferredBackBufferWidth = 960;
            graphics.ApplyChanges();

            this.Window.Title = "Test Game";
            Globals.m_windowHeight = graphics.PreferredBackBufferHeight;
            Globals.m_windowWidth = graphics.PreferredBackBufferWidth;
            Content.RootDirectory = "Content";
            #endregion

            Globals.m_rng = new Random();
            this.IsMouseVisible = false;

            m_options = new OptionsObject();

            Globals.m_mousePosition = new Vector2(0, 0);
            
            Globals.m_gameWidth = 1260;
            Globals.m_gameHeight = 1260;

            Globals.m_backgroundRectangle = new Rectangle(0, 0, 960, 544);
            Globals.m_backgroundRectangle2 = new Rectangle(-960, 0, 960, 544);

            m_options.LoadOptions();

            //Globals.m_fullscreen = m_options.m_fullscreen;
            Globals.m_volume = m_options.m_volume;
            
        }
示例#3
0
        public HelpState()
            : base()
        {
            m_backgroundSprite = content.Load<Texture2D>("Images/MenuBackground");
            m_titleTexture = content.Load<Texture2D>("Images/HelpAndOptionsTitle");
            m_buttonTexture = content.Load<Texture2D>("Images/arrows");
            m_playerTexture = content.Load<Texture2D>("Images/playerNoGlow");
            m_playerGlowTexture = content.Load<Texture2D>("Images/playerGlow");
            m_indicator = content.Load<Texture2D>("Images/topLeftSelector");

            m_playerColourButtonTexture = content.Load<Texture2D>("Images/PlayerColourText"); 
            m_instructionsButtonTexture = content.Load<Texture2D>("Images/InstructionsText");
            m_volumeButtonTexture = content.Load<Texture2D>("Images/VolumeText");
            m_controlsButtonTexture = content.Load<Texture2D>("Images/ControlsText");
            m_enemiesButtonTexture = content.Load<Texture2D>("Images/EnemiesText");
            //m_fullscreenButtonTexture = content.Load<Texture2D>("Images/FullscreenText");
            m_powerupsButtonTexture = content.Load<Texture2D>("Images/PowerupsText");
            m_backButtonTexture = content.Load<Texture2D>("Images/BackText");

            m_enemiesInformation = content.Load<Texture2D>("Images/Enemies");
            m_pcControls = content.Load<Texture2D>("Images/PCControls");
            m_vitaControls = content.Load<Texture2D>("Images/VitaControls");
            m_gamePadControls = content.Load<Texture2D>("Images/GamePadControls");
            m_powerupInformation = content.Load<Texture2D>("Images/PowerupsInformation");
            m_instructionsInformation = content.Load<Texture2D>("Images/Instructions");

            m_blipSound = content.Load<SoundEffect>("Sounds/Blip");
            m_options = new OptionsObject();
            m_options.LoadOptions();

            m_buttonSelected = 0;

            m_red = m_options.m_red;
            m_green = m_options.m_green;
            m_blue = m_options.m_blue;
            m_volume = m_options.m_volume;
            //m_fullscreen = m_options.m_fullscreen;
            m_imageJustOverlayed = false;

            m_showInstructions = false;
            m_showGamePadControls = false;
            m_showKeyboardControls = false;
            m_showVitaControls = false;
            m_showEnemies = false;
            m_showPowerups = false;
            
            m_text = Color.White;

            m_redUpButton = new Button(370, 190, 16, 16, m_buttonTexture);
            m_redDownButton = new Button(370, 280, 16, 16, m_buttonTexture);
            m_greenUpButton = new Button(410, 190, 16, 16, m_buttonTexture);
            m_greenDownButton = new Button(410, 280, 16, 16, m_buttonTexture);
            m_blueUpButton = new Button(450, 190, 16, 16, m_buttonTexture);
            m_blueDownButton = new Button(450, 280, 16, 16, m_buttonTexture);
            m_volumeUpButton = new Button(410, 335, 16, 16, m_buttonTexture);
            m_volumeDownButton = new Button(410, 405, 16, 16, m_buttonTexture);
           // m_fullscreenButton = new Button(420, 415, 16, 16, m_buttonTexture);
            m_instructionsButton = new Button(680, 175, 224, 40, m_instructionsButtonTexture);
            m_enemiesButton = new Button(675, 330, 155, 40, m_enemiesButtonTexture);
            m_powerupsButton = new Button(685, 415, 175, 40, m_powerupsButtonTexture);
            m_backButton = new Button(478, 498, 100, 40, m_backButtonTexture);
            m_controlsButton = new Button(680, 250, 155, 40, m_controlsButtonTexture);

            m_indicatorLeft.X = m_redUpButton.m_texturePosition.X - m_redUpButton.m_rectangle.Width / 2;
            m_indicatorLeft.Y = m_redUpButton.m_texturePosition.Y - 8;

            m_indicatorRight.X = m_redUpButton.m_texturePosition.X + m_redUpButton.m_rectangle.Width / 2;
            m_indicatorRight.Y = m_redUpButton.m_texturePosition.Y + 8;
        }