public void Initialize(ContentManager Content) { //ScreenHeight = graphics.PreferredBackBufferHeight; //ScreenWidth = graphics.PreferredBackBufferWidth; CollisionItemList = new List <ICollide>(); InvisibleObjectCollisionList = new List <ICollide>(); MovingObjectsList = new List <ICollide>(); charactersList = new List <IMoveableObject>(); HeroList = new List <IMoveableObject>(); DeathlyObjectsList = new List <ICollide>(); removeObjects = new List <IDrawObject>(); hero = new Hero(Content) { _Movement = new MovementArrowKeys() }; camera = new Camera2d() { Zoom = 1.5f }; collider = new CollitionChecker(); CurrentLevel = new Level1(Content); backGroundLevel1 = new Background(Content); //base.Initialize(); }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public void Update(GameTime gameTime, Camera2d camera) { foreach (IUpdate temp2 in MovingObjectsList) { temp2.Update(gameTime); } foreach (IUpdate temp3 in charactersList) { if (!(temp3 is Hero)) { temp3.Update(gameTime); } } CheckAllCollisions(); hero.Update(gameTime); camera.Follow(hero); }
/// <summary> /// Initialiseert alles voor de game /// </summary> public void Initialize(ContentManager Content, int screenHeight, int screenWidth) { content = Content; ScreenHeight = screenHeight; ScreenWidth = screenWidth; CollisionItemList = new List <ICollide>(); charactersList = new List <IMoveableObject>(); removeObjects = new List <IDrawObject>(); hero = new Hero(Content) { _Movement = new MovementArrowKeys() }; camera = new Camera2d() { Zoom = 1.5f }; collider = new CollitionChecker(); currentLevel = new Level1(Content); backGroundLevel = new Background(Content, "BackgroundLevel1", ScreenWidth, ScreenHeight); }