Exemplo n.º 1
0
 public void Initialize()
 {
     selectedWeapon = new Pistol(this);
     //GameWorld.AddGameObject(selectedWeapon, GameWorld.ActiveRoom);
     movementSpeed = 0.1f;
     if (isBoss)
     {
         health = 20;
         selectedWeapon.ReloadSpeed = 1f;
         selectedWeapon.AttackSpeed = .1f;
         selectedWeapon.Size       *= 2;
         selectedWeapon.ClipSize    = 25;
         Pistol p = selectedWeapon as Pistol;
         if (p != null)
         {
             p.ProjectileSpeed = 2800f;
         }
         stopThreshold  = 1000f;
         lootDropChance = 5;
         ChangeSprite(Assets.BossSprite);
         drawLayer = .05f;
     }
     else
     {
         health    = 2;
         drawLayer = .06f;
         ChangeSprite(Assets.EnemySprite);
     }
 }
Exemplo n.º 2
0
 public Projectile(Pistol pistol, float movementSpeed, Vector2 targetCords)
 {
     this.pistol        = pistol;
     this.movementSpeed = movementSpeed;
     this.targetCords   = targetCords;
     position           = pistol.Position;
     shooter            = pistol.Holder;
     movement           = targetCords - position;
     ChangeSprite(Assets.BulletSprite);
     rotation  = Helper.CalculateAngleBetweenPositions(position, targetCords);
     drawLayer = 0.8f;
 }