Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. if (direction == "left" && mazearray[xIndex - 1, yIndex].canPass == false && x <= (xIndex * 18) + 3)
  2. {
  3.  
  4. System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Users\vroy\Desktop\LOG.txt");
  5.  
  6. file.WriteLine("ENTERING LEFT");
  7. file.WriteLine(x + " , " + y);
  8. if (PacMan.yIndex > yIndex)
  9. {
  10. file.WriteLine("yIndex more");
  11. }
  12. if (PacMan.yIndex < yIndex)
  13. {
  14. file.WriteLine("yIndex less");
  15. }
  16. if (PacMan.xIndex == xIndex)
  17. {
  18. file.WriteLine("xIndex same");
  19. }
  20. file.WriteLine("METHOD CALL ENDED");
  21.  
  22.  
  23. if (PacMan.yIndex > yIndex && mazearray[xIndex, yIndex + 1].canPass == true)
  24. {
  25. direction = "down";
  26. Console.WriteLine("CHOICE DOWN");
  27. return;
  28. }
  29. if (PacMan.yIndex < yIndex && mazearray[xIndex, yIndex].canPass == true && y <= (yIndex * 18) + 3)
  30. {
  31. file.WriteLine("ENTERING UP");
  32. direction = "up";
  33. return;
  34. }
  35. if (PacMan.xIndex == xIndex)
  36. {
  37. if (mazearray[xIndex, yIndex + 1].canPass == true)
  38. {
  39. direction = "down";
  40.  
  41. }
  42. else
  43. {
  44. direction = "up";
  45. }
  46.  
  47.  
  48. }
  49. file.Close();
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement