public IGameObject CreateGapTile(Vector2 position) { var createdObject = new GapTile(position); var sprite = new FixedSprite(createdObject, dungeonSpriteAtlas, new Rectangle(984, 28, 16, 16)); createdObject.Sprite = sprite; return(createdObject); }
protected void createGapTileRectangle(int x, int y, int width, int height, int level) { for (int i = x; i < x + width; i++) { for (int j = y; j < y + height; j++) { tileMap[level][i, j] = new GapTile(); } } }
private static void SpawnFromString(IRoom room, SpriteBatch spriteBatch, string spawnType, int offsetX, int offsetY, int gridX, int gridY) { int posX = offsetX + gridX * RoomConstants.TileLength; int posY = offsetY + gridY * RoomConstants.TileLength; Point position = new Point(posX, posY); IBlock blockType; INpc npcType; IItem itemType; IBackground backgroundType; switch (spawnType) { //Blocks case RoomConstants.Block: blockType = new Square(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.BrickTile: blockType = new BrickTile(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.GapTile: blockType = new GapTile(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.Fire: position.X += RoomConstants.TileLength / 2; blockType = new Fire(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.LadderTile: backgroundType = new LadderTile(spriteBatch, position); room.AllObjects.Spawn(backgroundType); break; case RoomConstants.Stairs: blockType = new Stairs(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.FishStatue: blockType = new FishStatues(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.DragonStatue: blockType = new DragonStatues(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.BlueGrass: backgroundType = new TileBlueGrass(spriteBatch, position); room.AllObjects.Spawn(backgroundType); break; case RoomConstants.Water: blockType = new TileWater(spriteBatch, position); room.AllObjects.Spawn(blockType); break; case RoomConstants.MovableBlock: blockType = new MovableSquare(spriteBatch, position); ((RoomWithMovableSquare)room).AddMovableSquare((MovableSquare)blockType); room.AllObjects.Spawn(blockType); break; //Npcs case RoomConstants.Aquamentus: position.Y += RoomConstants.TileLength / 2; npcType = new Aquamentus(spriteBatch, position, room.AllObjects); room.AllObjects.Spawn(npcType); break; case RoomConstants.Bat: npcType = new Bat(spriteBatch, position); room.AllObjects.Spawn(npcType); break; case RoomConstants.Goriya: npcType = new Goriya(spriteBatch, position, room.AllObjects); room.AllObjects.Spawn(npcType); break; case RoomConstants.Hand: npcType = new Hand(spriteBatch, position, ((RoomWallMaster)room).GetWallMasterRoomToJumpTo()); room.AllObjects.Spawn(npcType); break; case RoomConstants.Jelly: npcType = new Jelly(spriteBatch, position); room.AllObjects.Spawn(npcType); break; case RoomConstants.OldMan: position.X += RoomConstants.TileLength / 2; npcType = new OldMan(spriteBatch, position); room.AllObjects.Spawn(npcType); break; case RoomConstants.Skeleton: npcType = new Skeleton(spriteBatch, position); room.AllObjects.Spawn(npcType); break; case RoomConstants.SpikeTrap: npcType = new SpikeTrap(spriteBatch, position, room.AllObjects.GetPlayer(0)); room.AllObjects.Spawn(npcType); break; //Items case RoomConstants.Compass: itemType = new CompassItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; case RoomConstants.Heart: position.X += (int)(4 * RoomConstants.SpriteMultiplier); position.Y += (int)(4 * RoomConstants.SpriteMultiplier); itemType = new HeartItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; case RoomConstants.Key: itemType = new KeyItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; case RoomConstants.Map: itemType = new MapItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; case RoomConstants.Triforce: position.X += (int)(12 * RoomConstants.SpriteMultiplier); position.Y += (int)(2 * RoomConstants.SpriteMultiplier); itemType = new TriforceItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; case RoomConstants.HeartContainer: itemType = new HeartContainerItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; case RoomConstants.Bow: itemType = new BowItem(spriteBatch, position); room.AllObjects.Spawn(itemType); break; default: break; } }