Exemplo n.º 1
0
        public void Fire(Vector2 position, Facing facing, Character user)
        {
            if (this.FireRate < this.WeaponType.FireRate)
                return;

            Bullet bullet = this.WeaponType.BulletType.Pool.New();
            bullet.Fire(position, facing, user);
            GameManager.BulletLayer.AddChild(bullet);

            this.FireRate = 0;
        }
Exemplo n.º 2
0
        public void Fire(Vector2 position, Facing facing, Character shooter)
        {
            this.Position = position;
            this.Facing = facing;
            this.Shooter = shooter;
            this.Activate();
            this.ParticleEngine.Start();

            this.Velocity.X = Util.FacingToVelocity(facing) * this.BulletType.Speed.X;
            this.Velocity.Y = this.BulletType.Speed.Y;
            this.Mass = this.BulletType.Mass;
        }