Example #1
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     instance = this; //om game1 te kunnen benaderen vanuit andere classes.
     contentInstance = this.Content;
 }
Example #2
0
 public BaseGameState(Game game)
     : base(game)
 {
     Content = game.Content;
     OurGame = (Game1)game;
 }
Example #3
0
 public health(Game1 game1)
     : base(game1)
 {
     // TODO: Construct any child components here
     this.game = game1;
 }
Example #4
0
 public Scrollen(Game1 game, Level1 Level1)
     : base(game)
 {
     this.level1 = Level1;
 }
Example #5
0
 public Level3(ContentManager content, Game1 game1)
 {
     this.game = game1;
     character = new Character(game1); //"game1" omdat character een constructor heeft
 }
Example #6
0
 public OptionsMenu(ContentManager content, Game1 game1)
 {
     this.menuFont = content.Load<SpriteFont>("menu");
     this.game = game1;
 }
Example #7
0
 public DeathScreen(ContentManager content, Game1 game1)
 {
     this.menuFont = content.Load<SpriteFont>("menu");
     this.deathFont = content.Load<SpriteFont>("death");
     this.game = game1;
 }
Example #8
0
 public MainMenu(ContentManager content, Game1 game1)
 {
     this.menuFont = content.Load<SpriteFont>("menu");
     this.titelFont = content.Load<SpriteFont>("titel");
     this.game = game1;
 }
Example #9
0
        public static void respawn(Game1 game)
        {
            if (game.currentLevel == game.level1)
            {
                for (int i = 0; i < Level1.platforms.Count; i++) // Platformen op begin positie plaatsen
                {
                    Level1.platforms[i].boundingBox = new Rectangle((int)Level1.startDimPlat[i].X, (int)Level1.startDimPlat[i].Y, Level1.platforms[i].boundingBox.Width, Level1.platforms[i].boundingBox.Height);
                    Level1.platforms[i].boundingBoxTop = new Rectangle(Level1.platforms[i].boundingBox.X, Level1.platforms[i].boundingBox.Y, Level1.platforms[i].boundingBox.Width, 5);
                }

                game.level1.Initialize();
                health.lifes = health.startLifes;
                score.currentScore = 0;

                for (int i = 0; i < Level1.coins.Count; i++)
                {
                    coins.taken[i] = false;
                }

                game.level1.gun.picked = false;
                carryingGun = false;

                currentState = state.standing;
                currentFacing = facing.right;
                jumpingSpeed = -20;
                jumpCount = 0;
            }
        }
Example #10
0
        float speed = 0; //Snelheid waarmee character zich in de horizontale richting voortbeweegt

        #endregion Fields

        #region Constructors

        //Constructor
        public Character(Game1 game1)
        {
            this.game = game1;

            playerTexture = Game1.character1Texture; //Laat de character met character1Texture beginnen
        }
Example #11
0
 static void Main()
 {
     using (var game = new Game1())
         game.Run();
 }