Asteroids.Classes.BasicBullet.GetTextureHeight C# (CSharp) Méthode

GetTextureHeight() public méthode

public GetTextureHeight ( ) : int
Résultat int
        public int GetTextureHeight()
        {
            tempTexture = GetTexture();
            return tempTexture.Height;
        }

Usage Example

Exemple #1
0
 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;
 }