コード例 #1
0
ファイル: Player.cs プロジェクト: Timvangool/AsteroidsAPO2
 public Weapon Shoot(int weapon)
 {
     // 1 = basic bullet
     if (weapon == 1)
     {
         BasicBullet basic = new BasicBullet();
         basic.SetTexture(bulletTexture);
         hitboxWidth = (basic.GetTextureWidth() / 2);
         hitboxHeight = (basic.GetTextureHeight() / 2);
         tempPlayerPos.X = (playerPos.X - hitboxWidth);
         tempPlayerPos.Y = (playerPos.Y - hitboxHeight);
         basic.SetPos(tempPlayerPos);
         basic.SetDirection(bulletDirection);
         delay = maxDelay;
         return basic;
     }
     return null;
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: Timvangool/AsteroidsAPO2
 public Weapon Shoot(int weapon)
 {
     // 1 = basic bullet
     if (weapon == 1)
     {
         BasicBullet basic = new BasicBullet();
         basic.SetTexture(bulletTexture);
         hitBoxWidht = basic.GetTexture().Width / 2;
         hitBoxHeight = basic.GetTexture().Height / 2;
         tempPos.X = playerPos.X - hitBoxWidht;
         tempPos.Y = playerPos.Y - hitBoxHeight;
         basic.SetPos(tempPos);
         basic.SetDirection(bulletDirection);
         delay = maxDelay;
         return basic;
     }
     return null;
 }
コード例 #3
0
ファイル: Player.cs プロジェクト: Timvangool/AsteroidsAPO2
 public Weapon Shoot(int weapon)
 {
     // 1 = basic bullet
     if (weapon == 1)
     {
         BasicBullet basic = new BasicBullet();
         basic.SetTexture(bulletTexture);
         basic.SetPos(playerPos);
         basic.SetDirection(bulletDirection);
         delay = maxDelay;
         return basic;
     }
     return null;
 }