Example #1
0
File: Game.cs Project: Keilerr/csat
        public override void Init()
        {
            Settings.TextureDir = "../../data/texture/";
            string AudioDir = "../../data/";

            back      = Texture2D.Load("bg.jpg");
            img[0]    = Texture2D.Load("head.png", true);
            img[1]    = Texture2D.Load("ball.png", true);
            crosshair = Texture2D.Load("cross.png", true);

            font = BitmapFont.Load("fonts/comic12.png");

            BaseGame.Instance.CursorVisible = false; // hide mouse cursor
            //System.Windows.Forms.Cursor.Hide();

            if (player == null)
            {
                player = new OggPlayerFBN();
                player.SetCurrentFile(AudioDir + "music.ogg");
            }
            player.Play();

            snd1 = new AudioClip(AudioDir + "snd2.ogg");
            snd2 = new AudioClip(AudioDir + "snd1.ogg");

            Camera.Set2D();
            base.Init();
        }
Example #2
0
        public override void Init()
        {
            depthFBO = new FBO(0, 0, 1, true);
            ShadowMapping.Create(depthFBO, "lightmask.png");

            font = BitmapFont.Load("fonts/comic12.png");

            skybox = Sky.Load("sky/sky_", "jpg");
            world.Add(skybox);

            GLSLShader.SetShader("shadowmapping.shader", "SHADOWS");
            DotScene ds = DotScene.Load("scene1/scene1.scene", scene);

            world.Add(scene);

            actors[0] = AnimatedModel.Load("ugly/ukko.mesh");
            actors[0].LoadMD5Animation("act1", "ugly/ukko_action1.anim");
            actors[0].LoadMD5Animation("act2", "ugly/ukko_action2.anim");
            actors[0].LoadMD5Animation("act3", "ugly/ukko_action3.anim");
            actors[0].LoadMD5Animation("walk", "ugly/ukko_walk.anim");
            actors[0].SetAnimation("act2"); // idle anim
            actors[0].Scale = new Vector3(5, 5, 5);
            world.Add(actors[0]);

            lightImg = Billboard.Load("lightimg.png");

            Camera.Set3D();
            base.Init();
        }
Example #3
0
        public override void Init()
        {
            Settings.TextureDir = "../../data/texture/";
            string AudioDir = "../../data/";

            back   = Texture2D.Load("bg.jpg");
            img[0] = Texture2D.Load("head.png");
            font   = BitmapFont.Load("fonts/comic12.png");

            Camera.Set2D();
            base.Init();
        }
Example #4
0
        public override void Init()
        {
            Settings.TextureDir = "../../data/texture/";

            back      = Texture2D.Load("menu.jpg");
            crosshair = Texture2D.Load("cross.png", true);

            font = BitmapFont.Load("fonts/comic12.png");

            BaseGame.Instance.CursorVisible = false; // hide mouse cursor

            Camera.Set2D();
            base.Init();
        }
Example #5
0
 void Loading()
 {
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     try
     {
         BitmapFont font = BitmapFont.Load("fonts/comic12.png");
         Texture.UnBind(0);
         Camera.Set2D();
         font.Write("Loading...", 0, 0);
         font.Dispose();
         Texture.UnBind(0);
     }
     catch (Exception) { }
     SwapBuffers();
 }
Example #6
0
        public override void Init()
        {
            Particles.DisableSoftParticles();

            earth.SetParticle(Billboard.Load("earth.png", false), false, true, null);                                     // ei läpikuultava, varjostaa
            explosion.SetParticle(Billboard.Load("fire.png"), true, false, new ParticleCallback(RenderParticleCallback)); // läpikuultava, ei varjosta
            smoke.SetParticle(Billboard.Load("smoke.png"), true, true, null);                                             // läpikuultava, varjostaa
            SetupParticles(true, true, true);

            font = BitmapFont.Load("fonts/comic12.png");

            camera.Position = new Vector3(0, 0, 150);
            Camera.Set3D();
            base.Init();
        }
Example #7
0
        public override void Init()
        {
            // random positions for images
            for (int q = 0; q < 100; q++)
            {
                x[q] = Rnd.Next(600) + 100;
                y[q] = Rnd.Next(300) + 100;
                z[q] = (float)Rnd.NextDouble();
            }

            BaseGame.Instance.CursorVisible = false;

            back = Texture2D.Load("photo.jpg");
            img  = Texture2D.Load("mousecursor.png", true); // center origo (because rotating cursor)
            font = BitmapFont.Load("fonts/comic12.png");

            Camera.Set2D();
            base.Init();
        }
Example #8
0
        public override void Init()
        {
            colorFBO = new FBO(0, 0, 2, true); // 2 colorbufferia
            depthFBO = new FBO(0, 0, 0, true);
            blurH    = PostEffect.Load("blur.shader", "HORIZ");
            blurH.SetParameter("size", 1f / (float)colorFBO.Width);
            blurV = PostEffect.Load("blur.shader", "VERT");
            blurV.SetParameter("size", 1f / (float)colorFBO.Width);
            bloom = PostEffect.Load("bloom.shader", "");
            bloom.SetParameter("size", 0.001f);

            Particles.EnableSoftParticles();
            ShadowMapping.Create(depthFBO, "lightmask.png");

            font = BitmapFont.Load("fonts/comic12.png");

            skybox = Sky.Load("sky/sky2_", "jpg");
            world.Add(skybox);

            lightImg = Billboard.Load("lightimg.png");

            GLSLShader.SetShader("shadowmapping.shader", "SHADOWS");
            DotScene ds = DotScene.Load("scene1/scene1.scene", scene);

            world.Add(scene);

            actors[0] = AnimatedModel.Load("ugly/ukko.mesh");
            actors[0].LoadMD5Animation("act1", "ugly/ukko_action1.anim");
            actors[0].LoadMD5Animation("act2", "ugly/ukko_action2.anim");
            actors[0].LoadMD5Animation("act3", "ugly/ukko_action3.anim");
            actors[0].LoadMD5Animation("walk", "ugly/ukko_walk.anim");
            actors[0].SetAnimation("act2"); // idle anim
            actors[0].Position.Y = -0.5f;
            actors[0].Scale      = new Vector3(5, 5, 5);
            world.Add(actors[0]);

            explosion = Particles.Load("explosion.particles.xml", new ParticleCallback(RenderParticleCallback));
            smoke     = Particles.Load("smoke.particles.xml", null);
            actors[0].Add(smoke);

            Camera.Set3D();
            base.Init();
        }
Example #9
0
        public override void Init()
        {
            depthFBO = new FBO(0, 0, 1, true);
            ShadowMapping.Create(depthFBO, "lightmask.png");

            Fog.CreateFog(0.005f, Fog.Color);
            GLSLShader.SetShader("default.shader", "FOG");
            skybox = Sky.Load("sky/sky2_", "jpg");
            world.Add(skybox);

            GLSLShader.SetShader("default.shader", "LIGHTING:PERPIXEL:FOG");
            Model    scene = new Model();
            DotScene ds    = DotScene.Load("scene1/scene1.scene", scene);

            world.Add(scene);

            camPath = Path.GetPath("Path_camera");
            camPath.Attach(camera, true, true);

            font = BitmapFont.Load("fonts/comic12.png");

            Camera.Set3D();
            base.Init();
        }