Beispiel #1
0
        public void InitScene()
        {
            GameObject background = new GameObject(new Vector2(SceneManager.ScreenSize.X, 400, SceneManager.ScreenSize.X, 0), "", new Vector2(0, 250));

            background.Animator.AddTexture("BACKGROUND", new Bitmap("./Textures/BACKGROUND.png"), 3, 2000);
            background.Animator.CurrentTexture = "BACKGROUND";
            SceneManager.AddObject(background);

            GameObject sun = new GameObject(new Vector2(230, 300), "Sun", new Vector2(10, -25));

            sun.Animator.AddTexture("SUN", new Bitmap("./Textures/SUN.png"));
            sun.Animator.CurrentTexture = "SUN";
            SceneManager.AddObject(sun);

            menuHUD = new MenuHUD(gl);
            menuHUD.Init();
            SceneManager.HUD = menuHUD;

            // Play games' song
            long position;

            try {
                position = OutputDevice.GetPosition();
            } catch {
                position = 0;
            }

            if (position == 0)
            {
                keepPlaying = true;
                OutputDevice.PlaybackStopped += SongStopped;
                OutputDevice.Init(audioFile);
                OutputDevice.Play();
            }
        }