예제 #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);