示例#1
0
        public override void OnActivate(GameTime gameTime, Player activatedBy)
        {
            _currentWaitTime -= gameTime.ElapsedGameTime.Milliseconds;
            if (_currentWaitTime < 0)
            {
                _currentWaitTime = _maxWaitTime;

                _projectile = new LinearProjectile(activatedBy.World, this, ProjectileTarget.Enemy, EventType.DoorTrigger, false, 300, CenterEntity(activatedBy), MathHelper.ToRadians((int)activatedBy.CurrentSprite.CurrentAnimation * 90));
                _projectile.AnimatedSprites.Add("Normal", AnimatedSprite.Clone());

                activatedBy.World.Projectiles.Add(_projectile);
            }
        }
示例#2
0
        public World(ArmorPotionsGame game)
        {
            _game = game;
            _projectiles = new List<Projectile>();
            _projectilesToAdd = new List<Projectile>();

            _player = new Player(this, _game.Content.Load<Texture2D>(@"Player\PlayerWalking"), _game.Content.Load<Texture2D>(@"Player\SwordAttack"));
            _player.Position = new Vector2(350, 350);

            Rectangle clientBounds = _game.Window.ClientBounds;
            _camera = new Camera(_game, 0, 0, clientBounds.Width, clientBounds.Height, 1f);
            _game.Components.Add(_camera);

            MaxTileWidth = clientBounds.Width / Tile.Width;
            MaxTileHeight = clientBounds.Height / Tile.Height;
        }
示例#3
0
 public override void CollectedBy(Player player)
 {
     player.Inventory.PermaQuips.Add(this);
 }
示例#4
0
 public abstract void ActivatedBy(Player player);
示例#5
0
 public abstract void CollectedBy(Player player);
示例#6
0
 public override void OnUnEquip(Player removedBy)
 {
 }
示例#7
0
 public override void OnEquip(Player equippedBy)
 {
 }
示例#8
0
 public abstract void OnUnEquip(Player removedBy);
示例#9
0
 public abstract void OnEquip(Player equippedBy);
示例#10
0
 public abstract void OnActivate(GameTime gameTime, Player activatedBy);
示例#11
0
 public abstract void ConsumedBy(Player player);