Example #1
0
        static void Main(string[] args)
        {
            Game game = new Game("LD 48", Global.screenWidth, Global.screenHeight);

            game.SetWindowScale(1);
            //game.LockMouse = true;


            Global.player = game.AddSession("Player1");

            Global.player.Controller.AddAxis(Controls.Axis, Axis.CreateWASD());
            Global.player.Controller.AddButton(Controls.Action);


            Global.player.Controller.Button(Controls.Action).AddKey(Key.Space);

            SpriteData.Init();
            SpriteData.Load(Global.path + "Sprites.xml");

            Global.Font = new Otter.Font(Global.path + "Monocons.ttf");

            var sfx = new Sfx();

            game.FirstScene = new GameScene();

#if DEBUG
            game.OnUpdate += () =>
            {
                if (Input.Instance.KeyPressed(Key.Num1))
                {
                    Global.debug = !Global.debug;
                }
            };
#endif

            game.Start();

            game.OnEnd += () =>
            {
                Sfx.instance.gameMusic.Stop();
                Sfx.instance.tenseMusic.Stop();
                Sfx.instance.gameOverMusic.Stop();
            };
        }
Example #2
0
        public Sfx()
        {
            instance = this;

            sword  = new Sound(Global.path + "SFX/sword.wav");
            sword2 = new Sound(Global.path + "SFX/sword2.wav");

            death       = new Sound(Global.path + "SFX/death.wav");
            hurt        = new Sound(Global.path + "SFX/hurt.wav");
            breaksound  = new Sound(Global.path + "SFX/break.wav");
            breaksound2 = new Sound(Global.path + "SFX/break2.wav");
            drink       = new Sound(Global.path + "SFX/drink.wav");

            door     = new Sound(Global.path + "SFX/door.wav");
            shot     = new Sound(Global.path + "SFX/shot.wav");
            teleport = new Sound(Global.path + "SFX/shot.wav");
            pickup   = new Sound(Global.path + "SFX/pickup.wav");

            gameOverMusic = new Sound(Global.path + "SFX/gameOver.ogg");
            gameMusic     = new Music(Global.path + "SFX/game.ogg");
            tenseMusic    = new Music(Global.path + "SFX/tense.ogg");
        }