Beispiel #1
1
        /// <summary>
        /// Create a new game screen. Should be done every time there is a new game.
        /// </summary>
        /// <param name="theScreenEvent"></param>
        /// <param name="contentManager"></param>
        public GameScreen(EventHandler theScreenEvent,ContentManager contentManager)
            : base(theScreenEvent)
        {
            bScoreWasAdded = false;

            this.contentManager = contentManager;
            dlDoubleJumpTimer = new DanLabel(1150, 20, 100, 50);

            //Init our intrepid hero
            csHero = new ControlledSprite();

            bg = new LayeredBackground();

            djeJumpEffect = new DoubleJumpEffect();

            altimeter = new Altimeter(); // Make a camera for the screen with an altimeter
            cCamera = new Camera(50, 100, 600, 520, altimeter);

            blocks = new List<Sprite>();
            Sprite sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);

            // REVIST Set up the Arcing Block Manager with the difficulty
            arcingBlockManager = new ArcingBlockManager(cCamera, blocks, contentManager, 500, 300, 150, "Sprites/block2");
        }
        /// <summary>
        /// Create a new high score screen.
        /// </summary>
        /// <param name="theScreenEvent"></param>
        /// <param name="theContent"></param>
        /// <param name="myConfig">The high scores are stored in the config object.</param>
        public HighScoreScreen(EventHandler theScreenEvent, ContentManager theContent)
            : base(theScreenEvent)
        {
            lbBackground = new LayeredBackground();

            dlHighscoreText = new DanLabel(600, 100, 200, 400);
        }
Beispiel #3
0
        /// <summary>
        /// Load the main menu screen.
        /// </summary>
        /// <param name="contentManager"></param>
        public override void LoadContent(ContentManager contentManager)
        {
            // Set the background.
            string [] assets = { "Backgrounds/space", "Clouds/cloudsspace"};
            lbBackground.LoadContent(contentManager, assets);

            // Set the Title picture
            spTitle.LoadContent(contentManager, "Sprites/climbtitle");
            spTitle.Position = new Vector2(100, 50);

            // Set up the menu.
            string [] opts = { "Play!", "Options!", "High Scores!", "Quit!" };
            EventHandler[] handlers = { new EventHandler(SelectPlayEvent), new EventHandler(SelectOptionsEvent),
                                          new EventHandler(SelectHighScoreEvent), new EventHandler(SelectQuitEvent) };
            mMenu.LoadContent(contentManager, opts, handlers);
            mMenu.SetBGColors(Gradients.TransparentBlueGradient);

            // Set up the MOTD.
            dlLabel = new DanLabel(100, 550, 600, 100, CUtil.MOTD);
            dlLabel.LoadContent(contentManager);

            // audio testing
            Song song = contentManager.Load<Song>("Audio/Sun and My Synth LOOPY");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 0.1f;
            MediaPlayer.Play(song);
            MediaPlayer.Stop();
            SoundEffect soundEffect = contentManager.Load<SoundEffect>("Audio/jumpsound");
            soundEffect.Play();
        }
Beispiel #4
0
 /// <summary>
 /// Load a new Altimeter
 /// </summary>
 public void LoadContent(ContentManager contentManager)
 {
     dlLabel = new DanLabel(5, 5, 300, 35);
     dlLabel.LoadContent(contentManager);
     font = contentManager.Load<SpriteFont>("verdana");
 }