Beispiel #1
0
 public override void _Process(float delta)
 {
     if (camera.grid_pos == camera.get_grid_pos(GlobalPosition))
     {
         if (camera.get_enemies() == 0)
         {
             if (anim.AssignedAnimation != "open")
             {
                 anim.Play("open");
             }
         }
         else if (!area.GetOverlappingBodies().Contains(player))
         {
             if (anim.AssignedAnimation != "close")
             {
                 anim.Play("close");
             }
         }
     }
     else
     {
         if (anim.AssignedAnimation != "open")
         {
             anim.Play("open");
         }
     }
 }