public void CreateWorld() { for (int x = 0; x < 14; x++) { blokArray[x] = new Blok(texture, new Vector2(num * 128, 520)); num++; } }
public void CreateWorld() { for (int x = 0; x < 2; x++) { for (int y = 0; y < 80; y++) { if (tileArray[x, y] == 0) { TilePos += 200; } if (tileArray[x, y] == 1) { blokArray[x, y] = new Blok(Tile1, new Microsoft.Xna.Framework.Vector2(TilePos, 520)); TilePos += 64; } if (tileArray[x, y] == 2) { blokArray[x, y] = new Blok(Tile2, new Microsoft.Xna.Framework.Vector2(TilePos, 470)); TilePos += 192; } if (tileArray[x, y] == 3) { blokArray[x, y] = new Blok(Tile3, new Vector2(TilePos, 370)); zombieList.Add(new Zombie(new Vector2(TilePos, 380))); TilePos += 384; } if (tileArray[x, y] == 4) { blokArray[x, y] = new Blok(Tile3, new Vector2(TilePos, 370)); zombieList.Add(new Zombie(new Vector2(TilePos, 380))); TilePos += 384; } if (tileArray[x, y] == 8) { blokArray[x, y] = new Blok(Fire, new Microsoft.Xna.Framework.Vector2(y * 160, 650 - 66)); } } } }
protected override void LoadContent() { Viewport viewport = graphics.GraphicsDevice.Viewport; spriteBatch = new SpriteBatch(GraphicsDevice); speler.LoadContent(Content); piloot.LoadContent(Content); background.LoadContent(Content); wolken.LoadContent(Content); score.LoadContent(Content); sound.LoadContent(Content); startMenu = Content.Load <Texture2D>("startMenu"); EndMenu = Content.Load <Texture2D>("endMenu"); jumpMenu = Content.Load <Texture2D>("planet"); levelUPTexture = Content.Load <Texture2D>("level_up"); missionEnded = Content.Load <Texture2D>("rsz_mission"); level2Entry = Content.Load <Texture2D>("level1_Accomplished"); //Level One Plateform Texture2D blokText = Content.Load <Texture2D>("blok"); //Level Twee platform Texture2D Tile1 = Content.Load <Texture2D>("Tile_1"); Texture2D Tile2 = Content.Load <Texture2D>("Tile_2"); Texture2D Tile3 = Content.Load <Texture2D>("Tile3"); Texture2D Tile4 = Content.Load <Texture2D>("Tile_4"); Texture2D Fire = Content.Load <Texture2D>("rsz_fire"); blokje = new Blok(blokText, new Vector2(30, 30)); level = new Level(); level.texture = blokText; level.CreateWorld(); level2 = new Level2(); level2.Tile1 = Tile1; level2.Tile2 = Tile2; level2.Tile3 = Tile3; level2.Tile4 = Tile4; level2.Fire = Fire; level2.CreateWorld(); collideObjecten = new List <ICollide>(); //Loading zombie in level 2 foreach (var zombie in level2.zombieList) { zombie.LoadContent(Content); } //Collison plateform Level 1 for (int i = 0; i < level.blokArray.GetLength(0); i++) { if (level.blokArray[i] != null) { collideObjecten.Add(level.blokArray[i]); } } //Collision plateform level 2 for (int i = 0; i < level2.blokArray.GetLength(0); i++) { for (int j = 0; j < level2.blokArray.GetLength(1); j++) { if (level2.blokArray[i, j] != null) { collideObjecten.Add(level2.blokArray[i, j]); } } } }