public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; instance = this; //om game1 te kunnen benaderen vanuit andere classes. contentInstance = this.Content; }
public BaseGameState(Game game) : base(game) { Content = game.Content; OurGame = (Game1)game; }
public health(Game1 game1) : base(game1) { // TODO: Construct any child components here this.game = game1; }
public Scrollen(Game1 game, Level1 Level1) : base(game) { this.level1 = Level1; }
public Level3(ContentManager content, Game1 game1) { this.game = game1; character = new Character(game1); //"game1" omdat character een constructor heeft }
public OptionsMenu(ContentManager content, Game1 game1) { this.menuFont = content.Load<SpriteFont>("menu"); this.game = game1; }
public DeathScreen(ContentManager content, Game1 game1) { this.menuFont = content.Load<SpriteFont>("menu"); this.deathFont = content.Load<SpriteFont>("death"); this.game = game1; }
public MainMenu(ContentManager content, Game1 game1) { this.menuFont = content.Load<SpriteFont>("menu"); this.titelFont = content.Load<SpriteFont>("titel"); this.game = game1; }
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; } }
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 }
static void Main() { using (var game = new Game1()) game.Run(); }