Advertisement
Guest User

Untitled

a guest
Nov 26th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. private SpriteBatch spriteBatch;
  2. private Color black;
  3. public void Effects(Player player)
  4. {
  5.     string compassString = "";
  6.     int playerY = (int) (((player.position.X + player.width) * 2f) / 16f);
  7.     if (playerY > 0)
  8.     {
  9.         compassString = "Distance: " + playerY + " feet left";
  10.         if (playerY == 1)
  11.         {
  12.         compassString = "Distance: " + playerY + " foot left";
  13.         }
  14.     }
  15.     else if (playerY < 0)
  16.     {
  17.         playerY *= -1;
  18.         compassString = "Distance: " + playerY + " feet right";
  19.         if (playerY == 1)
  20.         {
  21.             compassString = "Distance: " + playerY + " foot right";
  22.         }
  23.     }
  24.     else
  25.     {
  26.         compassString = "Distance: Level";
  27.     }
  28.     black.R = (byte)((0xff + black.R) / 2);
  29.     black.G = (byte)((0xff + black.R) / 2);
  30.     black.B = (byte)((0xff + black.R) / 2);
  31.     spriteBatch.DrawString(Main.fontMouseText, compassString, new Vector2((float) (0x16)), black);
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement