Exemple #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //graphics.PreferredBackBufferWidth = windowWidth;
            //graphics.PreferredBackBufferHeight = windowHeight;

            graphics.ApplyChanges();
            IsMouseVisible = true;

            btnPlay = new Button(Content.Load <Texture2D>("Play"), graphics.GraphicsDevice);
            btnPlay.setPosition(new Vector2(200, 400));

            btnPlayAgain = new Button(Content.Load <Texture2D>("playAgain2"), graphics.GraphicsDevice);
            btnPlayAgain.setPosition(new Vector2(200, 400));

            btnExit = new Button(Content.Load <Texture2D>("exit2"), graphics.GraphicsDevice);
            btnExit.setPosition(new Vector2(400, 400));

            btnExit2 = new Button(Content.Load <Texture2D>("exit2"), graphics.GraphicsDevice);
            btnExit2.setPosition(new Vector2(400, 400));

            dolphin        = new Dolphin(Content.Load <Texture2D>("si lumba lumba"), playerPosition, 140, 240, windowHeight);
            sky            = new Sky(Content.Load <Texture2D>("awan copy"), Content.Load <Texture2D>("awan copy2"), Content.Load <Texture2D>("awan copy3"), Content.Load <Texture2D>("awan copy4"), windowWidth, 380);
            ocean          = new Ocean(Content.Load <Texture2D>("seapolos1"), Content.Load <Texture2D>("seapolos2"), windowWidth, windowHeight);
            _3pilihan      = new _3choise(Content.Load <Texture2D>("si bubble"), Content.Load <SpriteFont>("medium"), initialNumber);
            staminaPict    = Content.Load <Texture2D>("dasaran stamina");
            highScorePict  = Content.Load <Texture2D>("highscore");
            ScorePict      = Content.Load <Texture2D>("score");
            staminaGauge   = new StaminaGauge(Content.Load <Texture2D>("stamina"), new Vector2(55, 5), 180, 40);
            score          = Content.Load <SpriteFont>("coinText");
            fontScore      = new Vector2(1100, 0);
            fontHighScore  = new Vector2(250, 0);
            fontHighScore2 = new Vector2(810, 0);
            // staminaBar = new Vector2(50,0);


            effect   = Content.Load <SoundEffect>("button-3");
            effect_1 = Content.Load <SoundEffect>("BUBBLE");
            effect_2 = Content.Load <SoundEffect>("dolphin");
            effect_3 = Content.Load <SoundEffect>("Reaction, Children Sound Effects");
            effect_4 = Content.Load <SoundEffect>("Disappointed Cartoon Booing Group Sound Effects");
            song     = Content.Load <Song>("CAREFREE AND HAPPY UPBEAT UKULELE INSTRUMENTAL BACKGROUND MUSIC - Mp3 Download (2.70 MB)");
            song_1   = Content.Load <Song>("Hans_zimmer_-_Beach_song_[HD_");
            MediaPlayer.Play(song);
            MediaPlayer.IsRepeating = true;

            number     = Content.Load <SpriteFont>("small");
            fontNumber = dolphin.numberPos;

            AddThing();
        }
Exemple #2
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            dolphin     = new Dolphin(Content.Load <Texture2D>("lmb"), playerPosition, 180, 320, height);
            sky         = new Sky(Content.Load <Texture2D>("awan copy"), Content.Load <Texture2D>("awan copy2"), width, 380);
            ocean       = new Ocean(Content.Load <Texture2D>("SEANEW"), Content.Load <Texture2D>("SEANEW"), width, height);
            score       = Content.Load <SpriteFont>("SpriteFont1");
            font1       = new Vector2(1100, 0);

            //coin = new Coin(Content.Load<Texture2D>("coin"), height);

            for (int i = 1; i <= 3; i++)
            {
                Random r = new Random();
                int    a = r.Next(1, 4);
                Console.WriteLine(a);
                listCoin.Add(new Coin(Content.Load <Texture2D>("coin"), a, i));
            }
        }