Beispiel #1
0
        private void DoGameLoop()
        {
            if (_isAutomatedControlled)
            {
                OnSnakeMove?.Invoke(Player1);
            }
            else
            {
                SetPlayerDirection();
            }

            Player1.MovePlayer();
            CheckForCollisions();
            GameCanvas.Invalidate();
        }
Beispiel #2
0
 public static void BroadcastSnakeMove(Bounds b) => OnSnakeMove?.Invoke(b);