Beispiel #1
0
        public void SendIntoGame(String _playerName)
        {
            player = new Player(id, _playerName, new Vector2(0, 0));

            if (GameLogic.gameStarted)
            {
                // .spectating = true;
                player.Die();
            }

            foreach (Client _client in Server.clients.Values)
            {
                if (_client.player != null)
                {
                    if (_client.id != id)
                    {
                        ServerSend.SpawnPlayer(id, _client.player);
                    }
                }
            }

            foreach (Client _client in Server.clients.Values)
            {
                if (_client.player != null)
                {
                    ServerSend.SpawnPlayer(_client.id, player);
                }
            }

            foreach (Animal _animal in GameLogic.animals)
            {
                if (_animal != null)
                {
                    ServerSend.SpawnAnimal(_animal);
                }
            }
        }