Beispiel #1
0
        private void CreatePhisycs()
        {
            List <Visualizer2D.Collider> walls = new List <Visualizer2D.Collider>();
            List <Visualizer2D.Collider> exits = new List <Visualizer2D.Collider>();

            exits.Add(Exit.Collider);
            foreach (var wall in Walls)
            {
                wall.Collider.OnCollisionCall = WallCollisionCallback;
            }
            walls.AddRange(Walls.ConvertAll(x => x.Collider));
            wallPhysics = new Visualizer2D.Physics2D(walls);
            exitPhysics = new Visualizer2D.Physics2D(exits);
            Exit.Collider.OnCollisionCall = ExitCollisionCallback;
        }
Beispiel #2
0
 public override CommonInterfaces.GameState Copy()
 {
     lock (this) {
         var gameState = new GameState();
         gameState.Players = Players.ConvertAll((p) => p.Copy());
         gameState.Coins   = Coins.ConvertAll((c) => c.Copy());
         gameState.Ghosts  = Ghosts.ConvertAll((g) => g.Copy());
         gameState.Walls   = Walls.ConvertAll((w) => w.Copy());
         gameState.Board   = Board.Copy();
         //last_inputs
         foreach (var input in lastInputs)
         {
             gameState.lastInputs.Add(input.Key, input.Value);
         }
         return(gameState);
     }
 }