protected GameObject CreateGameObject(DestroyableTileInfo trigger, DestroyableTileInfo destroyable, Game game, Camera cam) { Trigger newTrigger = new Trigger(game, cam, trigger.Position, destroyable.Position, trigger.TileName, destroyable.TileName); return newTrigger; }
public void LoadContent() { background = game.Content.Load<Texture2D>("world"); _destinationBox = new Rectangle( 0, 0, _background.Width, _background.Height ); //Box on left platform _tiles.Add(new MoveableBox(game, new Point(340, 300), "box_small")); //Box on right half of map _tiles.Add(new MoveableBox(game, new Point(1400, 700), "box")); // Draws the left part of the bottom floor TileLine(TileType.DIRT_G_100x100, new Point(0, 800), 1600, DrawDir.HORIZONTAL); //Right part of bottom floor TileLine(TileType.DIRT_G_100x100, new Point(1800, 800), 2100, DrawDir.HORIZONTAL); //"Roof" TileLine(TileType.WALL_100x100, new Point(0, 0), 2100, DrawDir.HORIZONTAL); //Left wall TileLine(TileType.WALL_100x100, new Point(0, 0), 800, DrawDir.VERTICAL); //Right wall TileLine(TileType.WALL_100x100, new Point(2000, 0), 800, DrawDir.VERTICAL); //Small floor under gap between right and left part of bottom floor //TileLine(TileType.DIRT_100x100, new Point(1500, 950), 1800, DrawDir.HORIZONTAL); TileLine(TileType.DIRT_100x100, new Point(0, 900), 2100, DrawDir.HORIZONTAL); //blocks on the platform above PlaceTile(TileType.DIRT_10x10, new Point(1500, 940), true); PlaceTile(TileType.DIRT_10x10, new Point(1790, 940), true); //Top half of wall in middle of screen with small gap over floor TileLine(TileType.WALL_100x100, new Point(850, 300), 600, DrawDir.VERTICAL); TileLine(TileType.WALL_100x100, new Point(950, 300), 600, DrawDir.VERTICAL); // Platform right of gap with trigger. PlaceTile(TileType.WALL_50x50, new Point(1050, 550), true); PlaceTile(TileType.WALL_50x50, new Point(1100, 550), true); Trigger botTrigger = new Trigger(game, new Point(1050, 500), new Point(880, 600), "detonator", "destroyable_tile_small"); triggerTile.Add(botTrigger); _tiles.Add(botTrigger.GetDestroyableTile()); //bottom half of wall in middle of screen with small gap TileLine(TileType.WALL_100x100, new Point(850, 700), 1050, DrawDir.HORIZONTAL); //Platform on left part of screen TileLine(TileType.WALL_50x50, new Point(300, 625), 700, DrawDir.HORIZONTAL); //block on the platform above, left and right TileLine(TileType.WALL_10x10, new Point(300, 615), 330, DrawDir.HORIZONTAL); PlaceTile(TileType.WALL_10x10, new Point(690, 615), true); //Stairs to get to the top and open block for jump guy PlaceTile(TileType.WALL_50x50, new Point(1450, 650), true); TileLine(TileType.WALL_100x100, new Point(1500, 600), 2000, DrawDir.HORIZONTAL); TileLine(TileType.WALL_100x100, new Point(1600, 500), 2000, DrawDir.HORIZONTAL); TileLine(TileType.WALL_100x100, new Point(1700, 400), 2000, DrawDir.HORIZONTAL); //top platform TileLine(TileType.WALL_100x100, new Point(950, 300), 1200, DrawDir.HORIZONTAL); TileLine(TileType.WALL_50x50, new Point(1250, 350), 1550, DrawDir.HORIZONTAL); Trigger topTrigger = new Trigger(game, new Point(950, 250), new Point(825, 200), "detonator", "destroyable_tile"); triggerTile.Add(topTrigger); _tiles.Add(topTrigger.GetDestroyableTile()); //Goal tile _tiles.Add(new TargetTile(game, new Point(1900, 700), "target")); }