Beispiel #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Beispiel #2
0
 public Sprite(Game1 game, Texture2D texture, Vector2 position, Vector2 scale)
     : base(game)
 {
     _texture = texture;
     _position = position;
     _sourceRectangle = new Rectangle(0, 0, _texture.Width, _texture.Height);
     _color = Color.White;
     _scale = scale;
     _rotation = 0;
     _origin = Vector2.Zero;
 }
        public SpawnManager(Game1 game)
            : base(game)
        {
            Components = new GameComponentCollection();

            //for (int i = 0; i <= 30000; i += 1000)
            //{
            //    Console.WriteLine(i + ": " + CalcSpawnDelay(i));
            //}

            _lastSpawnTime = TimeSpan.FromSeconds(0);

            LevelNumber = 1;
        }
 public AnimatedSprite(Game1 game, Texture2D textureImage, Vector2 position, Point frameSize,
     Rectangle collisionOffset, Point currentFrame, Point sheetSize, Point frameOffset, string cueName,
     int millisecondsPerFrame = 16)
     : base(game, textureImage, position)
 {
     _frameSize = frameSize;
     _lastPosition = position;
     _lastDirection = 0;
     _collisionOffset = collisionOffset;
     _currentFrame = currentFrame;
     _sheetSize = sheetSize;
     _frameOffset = frameOffset;
     _cueName = cueName;
     _millisecondsPerFrame = millisecondsPerFrame;
 }
Beispiel #5
0
        public Reticle(Game1 game, Texture2D textureImage, Vector2 position,
            Point frameSize, Rectangle collisionOffset, Point currentFrame,
            Point sheetSize, Point frameOffset, int millisecondsPerFrame = 16)
            : base(game, textureImage, position, frameSize, collisionOffset, currentFrame,
            sheetSize, frameOffset, null, millisecondsPerFrame)
        {
            _scale = new Vector2(0.5f);

            _lastFire = int.MinValue;
            _baseFireDelay = 150;
            _powerupFireDelay = 100;
            _fireDelay = _baseFireDelay;

            MaxAmmo = 60;
            CurrentAmmo = MaxAmmo;
            _reloadDuration = TimeSpan.FromSeconds(1.5);
            _origin = new Vector2(64, 64);
        }
        public AutomatedSprite(Game1 game, Texture2D textureImage, Vector2 position, Point frameSize,
            Rectangle collisionOffset, Point currentFrame, Point sheetSize, Vector2 velocity, Point frameOffset, string cueName,
            float cogDist, int millisecondsPerFrame = 16, bool predator = false)
            : base(game, textureImage, position, frameSize, collisionOffset, currentFrame,
            sheetSize, frameOffset, cueName, millisecondsPerFrame)
        {
            _velocity = velocity;

            _cogDistSquared = cogDist * cogDist;

            _predator = predator;
            if (_predator)
                _maxHealth = 6;
            else
                _maxHealth = 2;

            _currentHealth = _maxHealth;

            GotoState(SpriteState.Walking);
        }
Beispiel #7
0
 public MainMenu(Game1 game)
     : base(game)
 {
 }
Beispiel #8
0
 public Sprite(Game1 game, Texture2D texture, Vector2 position)
     : this(game, texture, position, new Vector2(1, 1))
 {
 }
Beispiel #9
0
 public Sprite(Game1 game, Texture2D texture)
     : this(game, texture, Vector2.Zero)
 {
 }
Beispiel #10
0
 public GameMode(Game1 game)
     : base(game)
 {
     CurrentState = ModeState.None;
 }
Beispiel #11
0
 public Powerup(Game1 game, Texture2D texture)
     : base(game, texture)
 {
     Remove();
 }