Exemple #1
0
    public Map(string filename, GameMode mode)
    {
        this.filename = filename;
        this.mode     = mode;

        currentMap = this;
        scene      = new Scene.Scene(filename, this);
    }
Exemple #2
0
    public Map(string filename, GameMode mode, Player[] players)
    {
        this.filename = filename;
        this.mode     = mode;

        currentMap = this;
        scene      = new Scene.Scene(filename, this);

        List <Player> playerBuffer = new List <Player>(players);
        Random        r            = new Random();

        for (int i = 0; i < players.Length; i++)
        {
            int index = r.Next(playerBuffer.Count);

            if (playerBuffer[index] != null)
            {
                PlayerJoin(playerBuffer[index].client, playerBuffer[index].playerName);
            }

            playerBuffer.RemoveAt(index);
        }
    }
Exemple #3
0
        //Chamado apenas uma vez quando inicializa a janela
        protected override void OnLoad(EventArgs e)
        {
            // Carrega o arquivo da cena e consequentemente os modelos 3D listados no arquivo json
            scene = new Scene.Scene("scenes/scene.json");

            GL.ClearColor(0.2f, 0.3f, 0.3f, 1.0f);
            GL.Enable(EnableCap.Multisample);
            GL.Enable(EnableCap.DepthTest);
            GL.DepthFunc(DepthFunction.Less);
            GL.DepthMask(true);
            GL.DepthRange(scene._camera._near, scene._camera._far);

            // Carrega o shader de pós processamento para aplicar na cena quando a tecla P ser pressionada
            postProcessing = new PostProcessing(Width, Height, "./examples_shader/quad_shader.vert", "./examples_shader/quad_shader.frag");

            CursorVisible = false;
            CursorGrabbed = true;

            // Carrega o shader do skybox com as imagens skybox_[direcao].jpg
            skybox = new Skybox("skybox");

            base.OnLoad(e);
        }