Example #1
0
 internal CloudObject(GameHost game, Texture2D texture)
     : base(game, Vector2.Zero, texture)
 {
     _game = game;
     PositionY = _game.GraphicsDevice.Viewport.Bounds.Height / 5.0f;
     PositionX = GameHelper.RandomNext(0, _game.GraphicsDevice.Viewport.Bounds.Width);
 }
Example #2
0
 public SpriteObject(GameHost game)
     : base(game)
 {
     ScaleX = 1;
     ScaleY = 1;
     SpriteColor = Color.White;
 }
 //-------------------------------------------------------------------------------------
 // Class constructors
 public MatrixCameraObject(GameHost game)
     : base(game)
 {
     // Set default chase parameters
     ChaseDistance = 1;
     ChaseElevation = 0.1f;
 }
 public MatrixParticleObjectBase(GameHost game, Texture2D texture, Vector3 position, Vector3 scale)
     : this(game)
 {
     ObjectTexture = texture;
     Position = position;
     Scale = scale;
 }
 public MatrixModelObject(GameHost game, Vector3 position, Model model)
     : this(game)
 {
     // Store the provided parameter values
     Position = position;
     ObjectModel = model;
 }
Example #6
0
 //-------------------------------------------------------------------------------------
 // Class constructors
 public SpriteObject(GameHost game)
     : base(game)
 {
     // Set the default scale and color
     ScaleX = 1;
     ScaleY = 1;
     SpriteColor = Color.White;
 }
        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="game">The GameHost object that owns this game mode</param>
        public GameModeBase(GameHost game)
        {
            // Store a reference to the game
            Game = game;

            // Create the list of game objects for this class
            GameObjects = new List<GameObjectBase>();
        }
Example #8
0
 internal OceanObject(GameHost game, Texture2D texture)
     : base(game, Vector2.Zero, texture)
 {
     _game = game;
     OriginY = texture.Height;
     PositionY = _game.GraphicsDevice.Viewport.Bounds.Height;
     ScaleX = _game.GraphicsDevice.Viewport.Bounds.Width * 1.0f / texture.Width;
     ScaleY = 1.0f;
 }
 //-------------------------------------------------------------------------------------
 // Class constructors
 public SpriteObject(GameHost game)
     : base(game)
 {
     // Set the default scale and color
     ScaleX = 1;
     ScaleY = 1;
     SpriteColor = Color.White;
     AutoHitTestMode = AutoHitTestModes.Rectangle;
 }
        //-------------------------------------------------------------------------------------
        // Class constructor

        /// <summary>
        /// Class constructor. Scope is internal so external code cannot create instances.
        /// </summary>
        internal HighScores(GameHost game)
        {
            // Store the game reference
            _game = game;
            
            // Set default property values
            FileName = "Scores.dat";

            // Initialize the highscore tables
            Clear();
        }
Example #11
0
        public RockObject(GameHost game, Texture2D texture, float speed, float lastRockX)
            : base(game, Vector2.Zero, texture)
        {
            _game = game;
            _speed = speed;
            _lastRockX = lastRockX;

            IsRockMove = true;
            Origin = new Vector2(texture.Width / 2, 0);

            Position = new Vector2(_lastRockX, _game.GraphicsDevice.Viewport.Bounds.Height - this.BoundingBox.Height);
        }
 //-------------------------------------------------------------------------------------
 // Class constructors
 public MatrixObjectBase(GameHost game)
     : base(game)
 {
     // Set the default object properties
     Transformation = Matrix.Identity;
     Scale = Vector3.One;
     ObjectColor = Color.White;
     SpecularColor = Color.Black;
     SpecularPower = 1;
     EmissiveColor = Color.Black;
     EnvironmentMapAmount = 1;
     EnvironmentMapSpecular = Color.Black;
     FresnelFactor = 0;
 }
        //-------------------------------------------------------------------------------------
        // Constructors
        public SettingsItemObject(GameHost game, SpriteFont font, Vector2 position, float scale, string name, string title, string defaultValue, string[] values)
            : base(game)
        {
            // Set object properties
            Position = position;
            Scale = new Vector2(scale);
            Font = font;
            Name = name;
            Title = title;
            Values = values;

            _valueIndex = GetValueIndex(SettingsManager.GetValue(name, defaultValue));

            // Set the text for the option item
            SetText();
        }
        //-------------------------------------------------------------------------------------
        // Class constructors
        public MatrixSkyboxObject(GameHost game, Texture2D texture, Vector3 position, Vector3 scale)
            : base(game)
        {
            // Have we already built the cube vertex array in a previous instance?
            if (_vertices == null)
            {
                // No, so build them now
                BuildVertices();
                // Create a vertex buffer
                _vertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionColorTexture), _vertices.Length, BufferUsage.WriteOnly);
                _vertexBuffer.SetData(_vertices);
            }

            // Set other object properties
            ObjectTexture = texture;
            Position = position;
            Scale = scale;
        }
 public TextObject(GameHost game, SpriteFont font, Vector2 position, String text)
     : this(game, font, position)
 {
     Text = text;
 }
Example #16
0
 //-------------------------------------------------------------------------------------
 // Class constructors
 public BenchmarkObject(GameHost game, SpriteFont font, Vector2 position, Color textColor)
     : base(game, font, position)
 {
     SpriteColor = textColor;
 }
Example #17
0
 public TextObject(GameHost game, SpriteFont font, Vector2 position, String text, TextAlignment horizontalAlignment, TextAlignment verticalAlignment)
     : this(game, font, position, text)
 {
     HorizontalAlignment = horizontalAlignment;
     VerticalAlignment = verticalAlignment;
 }
 //-------------------------------------------------------------------------------------
 // Class constructors
 /// <summary>
 /// Constructor for the object
 /// </summary>
 /// <param name="game">A reference to the MonoGame Game class inside which the object resides</param>
 public GameObjectBase(GameHost game)
 {
     // Store a reference to the game
     Game = game;
 }
 public TextObject(GameHost game, SpriteFont font, Vector2 position)
     : this(game, font)
 {
     PositionX = position.X;
     PositionY = position.Y;
 }
Example #20
0
 /// <summary>
 /// Virtual method which the game may override if it needs to respond to the game window resizing
 /// </summary>
 /// <param name="windowState">The new window state</param>
 /// <param name="newSize">A Vector2 structure containing the new window size</param>
 /// <param name="oldSize">A Vector2 structure containing the previous window size</param>
 protected internal virtual void Resize(GameHost.WindowStates windowState, Vector2 newSize, Vector2 oldSize)
 {
     // Nothing to do by default
 }
Example #21
0
 internal BallObject(GameHost game, Texture2D texture)
     : base(game, Vector2.Zero, texture)
 {
     _game = game;
     Reset();
 }
Example #22
0
 public GameObjectBase(GameHost game)
 {
     gameHost = game;
 }
 //-------------------------------------------------------------------------------------
 // Class constructors
 public MatrixModelObject(GameHost game)
     : base(game)
 {
 }
Example #24
0
 public SpriteObject(GameHost game, Vector2 position)
     : this(game)
 {
     // Store the provided position
     Position = position;
 }
 public SpriteObject(GameHost game, Vector2 position, Texture2D texture)
     : this(game, position)
 {
     // Store the provided texture
     SpriteTexture = texture;
 }
 public SpriteObject(GameHost game, Vector2 position)
     : this(game)
 {
     // Store the provided position
     Position = position;
 }
 public MatrixObjectBase(GameHost game, Vector3 position)
     : this(game)
 {
     // Store the provided position
     Position = position;
 }
Example #28
0
 public SpriteObject(GameHost game, Vector2 position)
     : this(game)
 {
     Position = position;
 }
 public MatrixObjectBase(GameHost game, Vector3 position, Texture2D texture)
     : this(game, position)
 {
     // Store the provided texture
     ObjectTexture = texture;
 }
Example #30
0
 public SpriteObject(GameHost game, Vector2 position, Texture2D texture)
     : this(game, position)
 {
     SpriteTexture = texture;
 }
        //-------------------------------------------------------------------------------------
        // Class constructors

        /// <summary>
        /// Constructor for the object
        /// </summary>
        /// <param name="game">A reference to the MonoGame Game class inside which the object resides</param>
        public GameObjectBase(GameHost game)
        {
            // Store a reference to the game
            Game = game;
        }
 public TextObject(GameHost game, SpriteFont font, Vector2 position, String text, TextAlignment horizontalAlignment, TextAlignment verticalAlignment)
     : this(game, font, position, text)
 {
     HorizontalAlignment = horizontalAlignment;
     VerticalAlignment   = verticalAlignment;
 }
 public MatrixObjectBase(GameHost game, Vector3 position, Texture2D texture)
     : this(game, position)
 {
     // Store the provided texture
     ObjectTexture = texture;
 }
 public TextObject(GameHost game, SpriteFont font)
     : this(game)
 {
     Font = font;
 }
Example #35
0
 public TextObject(GameHost game, SpriteFont font)
     : this(game)
 {
     Font = font;
 }
 public MatrixObjectBase(GameHost game, Vector3 position)
     : this(game)
 {
     // Store the provided position
     Position = position;
 }
Example #37
0
 public TextObject(GameHost game, SpriteFont font, Vector2 position)
     : this(game, font)
 {
     Position = position;
 }
Example #38
0
 public TextObject(GameHost game, SpriteFont font, Vector2 position, String text)
     : this(game, font, position)
 {
     Text = text;
 }
Example #39
0
 public SpriteObject(GameHost game, Vector2 position, Texture2D texture)
     : this(game, position)
 {
     // Store the provided texture
     SpriteTexture = texture;
 }