Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private SpriteBatch spriteBatch;
- private Color black;
- public void Effects(Player player)
- {
- string compassString = "";
- int playerY = (int) (((player.position.X + player.width) * 2f) / 16f);
- if (playerY > 0)
- {
- compassString = "Distance: " + playerY + " feet left";
- if (playerY == 1)
- {
- compassString = "Distance: " + playerY + " foot left";
- }
- }
- else if (playerY < 0)
- {
- playerY *= -1;
- compassString = "Distance: " + playerY + " feet right";
- if (playerY == 1)
- {
- compassString = "Distance: " + playerY + " foot right";
- }
- }
- else
- {
- compassString = "Distance: Level";
- }
- black.R = (byte)((0xff + black.R) / 2);
- black.G = (byte)((0xff + black.R) / 2);
- black.B = (byte)((0xff + black.R) / 2);
- spriteBatch.DrawString(Main.fontMouseText, compassString, new Vector2((float) (0x16)), black);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement