Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1.                                                                
  2.                                 foreach (object e in entities)
  3.                                 {                                
  4.                                     if (e is Ghost)
  5.                                     {
  6.                     Ghost ghost = (Ghost) e;
  7.                                         if (ghost.hitbox.Intersects(tiles[i, j].hitbox))      
  8. {                                
  9.                                         Console.WriteLine("hit");
  10.                                         ghost.pos.Y = ghost.prevPos.Y;
  11.                                         ghost.pos.X = ghost.prevPos.X;
  12.                                         ghost.SetDir(rnd.Next(1,4));
  13. }
  14.                                     }
  15.                                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement