Exemplo n.º 1
0
        public GamePlayScreen(Game1 game)
        {
            this.game = game;

            random = new Random();

            cakeTexture = game.Content.Load<Texture2D>("Cake");

            player = new Sprite();
            player.Texture = game.Content.Load<Texture2D>("Face");

            // Zoekt het midden op beiden de y op
            int screenCenterY = game.GraphicsDevice.Viewport.Height / 2;
            player.Position = new Vector2(
                10,                                             // x- as
                (screenCenterY) - (player.Texture.Height / 2)); // y-as
            // Player mond is collision met cake
            player.SetRelativeBoundingBox(20, 74, player.Texture.Width - 40, 20);

            // Score
            hud = new HUD();
            hud.Font = game.Content.Load<SpriteFont>("Arial");

            soundEffect = game.Content.Load<SoundEffect>("bite");
            song = game.Content.Load<Song>("yes");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(song);
        }
Exemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Exemplo n.º 3
0
 public StartScreen(Game1 game)
 {
     this.game = game;
     texture = game.Content.Load<Texture2D>("StartScreen");
     lastState = Keyboard.GetState();
 }