Advertisement
D8ms

code

Apr 22nd, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public class Player {
  2. public string name;
  3. public int player_number, movespeed, wins;
  4. public bool alive, playing, spectating;
  5. public Location coordinate;
  6.  
  7. public Player() {
  8. name = "Unknown Player";
  9. }
  10.  
  11. public init_Player(string name, int pnum) {
  12. this.name = name;
  13. this.player_number = pnum;
  14. this.movespeed = 300
  15. this.playing = true;
  16. this.spectating = false;
  17. this.wins = 0;
  18. }
  19.  
  20. public init_Spec(string name) {
  21. this.name = name;
  22. this.playing = false;
  23. this.spectating = true;
  24. }
  25.  
  26. public void PrintPlayer() {
  27. Console.WriteLine("name: {0}, player number: {1}", name, player_number);
  28. }
  29. }
  30.  
  31. public struct Location {
  32. public float x, y;
  33.  
  34. public init_Location(float x, float y) {
  35. this.x = x;
  36. this y = y;
  37. }
  38. }
  39.  
  40.  
  41. public float get_distance(float x1, float y1, float x2, float y2) {
  42. int float distance = Math.Sqrt(Math.Abs(x1*x1 + y1*y1 - (x2*x2 + y2*y2)))
  43. return distance
  44. }
  45.  
  46. public float get_angel(float x1, float y1, float x2, float y2) {
  47. int angle = Math.Sin(
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement