public void buildTileset() //string LevelFile, string Tiles { transitionPause = 0.0f; List <Dictionary <string, string> > bgString = FlxXMLReader.readNodesFromTmxFile("Lemonade/levels/slf2/" + Lemonade_Globals.location + "/bg" + Lemonade_Globals.location + ".tmx", "map", "bg", FlxXMLReader.TILES); FlxTilemap bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadMap(bgString[0]["csvData"], FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_" + Lemonade_Globals.location), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(0, 0); add(bgMap); levelAttrs = new Dictionary <string, string>(); levelAttrs = FlxXMLReader.readAttributesFromTmxFile("Lemonade/levels/slf2/" + Lemonade_Globals.location + "/" + Lemonade_Globals.location + "_level" + FlxG.level.ToString() + ".tmx", "map"); foreach (KeyValuePair <string, string> kvp in levelAttrs) { //Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); } FlxG.levelWidth = Convert.ToInt32(levelAttrs["width"]) * Convert.ToInt32(levelAttrs["tilewidth"]); FlxG.levelHeight = Convert.ToInt32(levelAttrs["height"]) * Convert.ToInt32(levelAttrs["tileheight"]); levelString = FlxXMLReader.readNodesFromTmxFile("Lemonade/levels/slf2/" + Lemonade_Globals.location + "/" + Lemonade_Globals.location + "_level" + FlxG.level.ToString() + ".tmx", "map", "bg", FlxXMLReader.TILES); //foreach (Dictionary<string, string> nodes in levelString) //{ // foreach (KeyValuePair<string, string> kvp in nodes) // { // //Console.Write("Key = {0}, Value = {1}, ", kvp.Key, kvp.Value); // } // //Console.Write("\r\n"); //} bgElementsTilemap = new FlxTilemap(); bgElementsTilemap.auto = FlxTilemap.STRING; bgElementsTilemap.indexOffset = -1; bgElementsTilemap.stringTileMin = 200; bgElementsTilemap.stringTileMax = 354; bgElementsTilemap.loadMap(levelString[0]["csvData"], FlxG.Content.Load <Texture2D>("Lemonade/tiles_" + Lemonade_Globals.location), 20, 20); bgElementsTilemap.boundingBoxOverride = false; add(bgElementsTilemap); collidableTilemap = new FlxTilemap(); collidableTilemap.auto = FlxTilemap.STRING; // TMX maps have indexOffset of -1; collidableTilemap.indexOffset = -1; collidableTilemap.stringTileMax = 200; collidableTilemap.loadMap(levelString[0]["csvData"], FlxG.Content.Load <Texture2D>("Lemonade/tiles_" + Lemonade_Globals.location), 20, 20); collidableTilemap.boundingBoxOverride = false; add(collidableTilemap); }
override public void create() { base.create(); for (int i = 0; i < 40; i++) { for (int y = 0; y < 40; y++) { FlxSprite x = new FlxSprite(i * 8, y * 8); x.loadGraphic("water", false, false, 8, 8); x.addAnimation("flow", new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, (int)FlxU.random(1, 7), true); x.play("flow"); add(x); } } FlxTilemap t = new FlxTilemap(); string map = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,1,0,1,1,1,0,0,0,0,0\n"; map += "0,0,1,0,0,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0\n"; map += "0,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0\n"; map += "0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; map += "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"; t.auto = FlxTilemap.AUTO; t.loadMap(map, FlxG.Content.Load <Texture2D>("autotilesIsland"), 8, 8); add(t); }
override public void create() { FlxG.Framerate = 50; //FlxG.flashFramerate = 50; // Creates a new tilemap with no arguments collisionMap = new FlxTilemap(); /* * FlxTilemaps are created using strings of comma seperated values (csv) * This string ends up looking something like this: * * 0,0,0,0,0,0,0,0,0,0, * 0,0,0,0,0,0,0,0,0,0, * 0,0,0,0,0,0,1,1,1,0, * 0,0,1,1,1,0,0,0,0,0, * ... * * Each '0' stands for an empty tile, and each '1' stands for * a solid tile * * When using the auto map generation, the '1's are converted into the corresponding frame * in the tileset. */ // Initializes the map using the generated string, the tile images, and the tile size collisionMap.loadMapFile(default_auto, auto_tiles, (int)TILE_WIDTH, (int)TILE_HEIGHT, FlxTilemap.AUTO); add(collisionMap); highlightBox = new FlxObject(0, 0, TILE_WIDTH, TILE_HEIGHT); setupPlayer(); // When switching between modes here, the map is reloaded with it's own data, so the positions of tiles are kept the same // Notice that different tilesets are used when the auto mode is switched autoAltBtn = new FlxButton(4, FlxG.height - 24, "AUTO", altButtonFunc); add(autoAltBtn); resetBtn = new FlxButton(8 + autoAltBtn.Width, FlxG.height - 24, "Reset", resetButtonFunc); add(resetBtn); quitBtn = new FlxButton(FlxG.width - resetBtn.Width - 4, FlxG.height - 24, "Quit", onQuit); add(quitBtn); helperTxt = new FlxText(5, 5, 150, "Click to place tiles. Shift-Click to remove tiles\nArrow keys to move"); add(helperTxt); // Show mouse pointer FlxG.mouse.show(); }
public void makeCave2(float Scroll, Color Col) { FlxCaveGeneratorExt caveExt = new FlxCaveGeneratorExt(150, 140, 0.45f, 5); string[,] caveLevel = caveExt.generateCaveLevel(); //Optional step to print cave to the console. //caveExt.printCave(caveLevel); string newMap = caveExt.convertMultiArrayStringToString(caveLevel); //Create a tilemap and assign the cave map. tiles = new FlxTilemap(); tiles.auto = FlxTilemap.STRING; tiles.loadMap(newMap, FlxG.Content.Load <Texture2D>("flixel/autotiles_16x16"), 16, 16); tiles.setScrollFactors(Scroll, Scroll); tiles.color = Col; add(tiles); }
public void makeCave(float Scroll, Color Col) { // make a new cave of tiles 50x40; FlxCaveGenerator cav = new FlxCaveGenerator(100, 100, 0.48f, 1); //Create a matrix based on these parameters. int[,] matr = cav.generateCaveLevel(3, 0, 2, 0, 1, 1, 1, 1); //convert the array to a comma separated string string newMap = cav.convertMultiArrayToString(matr); //Create a tilemap and assign the cave map. tiles = new FlxTilemap(); tiles.auto = FlxTilemap.AUTO; tiles.loadMap(newMap, FlxG.Content.Load <Texture2D>("flixel/autotiles_16x16"), 16, 16); tiles.setScrollFactors(Scroll, Scroll); tiles.color = Col; add(tiles); }
private void altButtonFunc() { switch (collisionMap.auto) { case FlxTilemap.AUTO: collisionMap.loadMap(FlxTilemap.arrayToCSV(collisionMap.getData(true), collisionMap.widthInTiles), alt_tiles, TILE_WIDTH, TILE_HEIGHT, FlxTilemap.ALT); autoAltBtn.Label.text = "ALT"; break; case FlxTilemap.ALT: collisionMap.loadMap(FlxTilemap.arrayToCSV(collisionMap.getData(true), collisionMap.widthInTiles), empty_tiles, TILE_WIDTH, TILE_HEIGHT, FlxTilemap.OFF); autoAltBtn.Label.text = "OFF"; break; case FlxTilemap.OFF: collisionMap.loadMap(FlxTilemap.arrayToCSV(collisionMap.getData(true), collisionMap.widthInTiles), auto_tiles, TILE_WIDTH, TILE_HEIGHT, FlxTilemap.AUTO); autoAltBtn.Label.text = "AUTO"; break; } }
override public void create() { FlxG.backColor = Color.DarkGreen; base.create(); FlxCamera cam1 = new FlxCamera(0, 0, FlxG.width / 2, FlxG.height, 1); cam1.color = Color.Blue; FlxG.cameras.Add(cam1); FlxCamera cam2 = new FlxCamera(FlxG.width / 2, 0, FlxG.width / 2, FlxG.height, 1); cam2.color = Color.GreenYellow; FlxG.cameras.Add(cam2); FlxTilemap t = new FlxTilemap(); t.auto = FlxTilemap.AUTO; t.loadMap("1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1\n1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1\n1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1\n1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,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1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1\n", FlxG.Content.Load <Texture2D>("flixel/autotiles"), 8, 8); add(t); FlxSprite s = new FlxSprite(0, 0, FlxG.Content.Load <Texture2D>("flixel/initials/initialsLogo")); add(s); s.velocity.X = 150; s.velocity.Y = 50; FlxG.follow(s, 10.0f); FlxG.followBounds(0, 0, 2000, 2000); }
public override void create() { // Background color FlxG.bgColor = (FlxColor.GREEN); FlxG.worldBounds = new FlxRect(0, 0, 320, 240); //Design your platformer level with 1s and 0s (at 40x30 to fill 320x240 screen) int[] data = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; //Create a new tilemap using our level data level = new FlxTilemap(); level.loadMap(FlxTilemap.arrayToCSV(data, 40), FlxTilemap.ImgAuto, 0, 0, FlxTilemap.AUTO); add(level); //Create the level exit, a dark gray box that is hidden at first exit = new FlxSprite(35 * 8 + 1, 25 * 8); exit.makeGraphic(14, 16, FlxColor.BLUE); exit.Exists = false; add(exit); //Create coins to collect (see createCoin() function below for more info) coins = new FlxGroup(); //Top left coins createCoin(18, 4); createCoin(12, 4); createCoin(9, 4); createCoin(8, 11); createCoin(1, 7); createCoin(3, 4); createCoin(5, 2); createCoin(15, 11); createCoin(16, 11); //Bottom left coins createCoin(3, 16); createCoin(4, 16); createCoin(1, 23); createCoin(2, 23); createCoin(3, 23); createCoin(4, 23); createCoin(5, 23); createCoin(12, 26); createCoin(13, 26); createCoin(17, 20); createCoin(18, 20); //Top right coins createCoin(21, 4); createCoin(26, 2); createCoin(29, 2); createCoin(31, 5); createCoin(34, 5); createCoin(36, 8); createCoin(33, 11); createCoin(31, 11); createCoin(29, 11); createCoin(27, 11); createCoin(25, 11); createCoin(36, 14); //Bottom right coins createCoin(38, 17); createCoin(33, 17); createCoin(28, 19); createCoin(25, 20); createCoin(18, 26); createCoin(22, 26); createCoin(26, 26); createCoin(30, 26); add(coins); //Create player (a red box) player = new FlxSprite(FlxG.width / 2 - 5); player.makeGraphic(10, 12, FlxColor.RED); player.MaxVelocity.X = 80; player.MaxVelocity.Y = 200; player.Acceleration.Y = 200; player.Drag.X = player.MaxVelocity.X * 4; add(player); score = new FlxText(2, 2, 80, "SCORE: "); //score.setShadow(FlxColor.BLACK); score.text = "SCORE: " + (coins.CountDead() * 100); add(score); status = new FlxText(FlxG.width - 160 - 2, 2, 160); //status.setShadow(0xff000000); //status.setAlignment("right"); switch (FlxG.score) { case 0: status.text = "Collect coins."; break; case 1: status.text = "Aww, you died!"; break; } add(status); }
override public void create() { base.create(); Lemonade_Globals.totalCoins = Lemonade_Globals.calculateTotalCoins(); FlxTilemap bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "bg", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(1, 1); add(bgMap); bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "bg2", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(1, 1); add(bgMap); FlxTilemap bgMap3 = new FlxTilemap(); bgMap3.auto = FlxTilemap.STRING; bgMap3.indexOffset = -1; bgMap3.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "stars", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap3.boundingBoxOverride = false; bgMap3.setScrollFactors(0.5f, 0.5f); add(bgMap3); FlxTilemap bgMap4 = new FlxTilemap(); bgMap4.auto = FlxTilemap.STRING; bgMap4.indexOffset = -1; bgMap4.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "city", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap4.boundingBoxOverride = false; bgMap4.setScrollFactors(1, 1); add(bgMap4); follower = new FlxSprite(400, 1500); follower.visible = false; add(follower); follower.velocity.Y = this.speed; FlxG.follow(follower, 20.0f); FlxG.followBounds(0, 0, int.MaxValue, 2000); int textSize = 2; #if __ANDROID__ textSize = 4; #endif heading = new FlxText(0, 50, FlxG.width, "Collection Incomplete"); heading.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), textSize, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); heading.setScrollFactors(0, 0); add(heading); string howWellDidYouGo = "Collected " + Lemonade_Globals.coins.ToString() + "\nfrom " + Lemonade_Globals.totalCoins.ToString() + " Coins "; credits = new FlxText(0, FlxG.height / 1.75f, FlxG.width, howWellDidYouGo); credits.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), textSize, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); credits.setScrollFactors(0, 0); credits.visible = false; add(credits); string ins = "Press X to Continue"; #if __ANDROID__ ins = "Press O to Continue"; #endif instruction = new FlxText(0, FlxG.height / 1.3f, FlxG.width, ins); instruction.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), textSize, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); instruction.setScrollFactors(0, 0); instruction.visible = false; add(instruction); if (Lemonade_Globals.coins == Lemonade_Globals.totalCoins) { heading.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), textSize, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); heading.text = "Complete Collection!!\nThe Lemonade Factory is saved."; instruction.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), textSize, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); string ins2 = "Press X to Continue"; #if __ANDROID__ ins2 = "Press O to Continue"; #endif instruction.text = ins2; //FlxU.openURL("http://initials.itch.io/slf2/download/Y9wdBOHe7a92Qpo9t5UJdz05HhZR5p10F0L6wfdP"); } tween = new Tweener(FlxG.height / 1.3f, FlxG.height / 1.2f, TimeSpan.FromSeconds(0.67f), XNATweener.Cubic.EaseInOut); tween.PingPong = true; tween.Start(); // play some music FlxG.playMp3("Lemonade/music/March", 0.75f); rain = new FlxGroup(); for (int i = 0; i < 150; i++) { FlxSprite rainDrop = new FlxSprite((FlxU.random() * FlxG.width * 2), -200 + (FlxU.random() * 1000)); rainDrop.loadGraphic("Lemonade/rain", true, false, 2, 2); rainDrop.frame = (int)FlxU.random(0, 6); rainDrop.velocity.Y = FlxU.random(350, 400); rain.add(rainDrop); } add(rain); splashes = new FlxEmitter(); splashes.createSprites("Lemonade/rain", 150, true, 0.0f, 0.0f); splashes.setXSpeed(-25, 25); splashes.setYSpeed(-30, 0); splashes.gravity = 1.0f; add(splashes); }
override public void create() { base.create(); Lemonade_Globals.totalCoins = Lemonade_Globals.calculateTotalCoins(); Console.WriteLine("Total coins = {0}", Lemonade_Globals.totalCoins); #if __ANDROID__ FlxG.BUILD_TYPE = FlxG.BUILD_TYPE_OUYA; #endif FlxTilemap bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "bg", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(1, 1); add(bgMap); bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "bg2", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(1, 1); add(bgMap); FlxTilemap bgMap3 = new FlxTilemap(); bgMap3.auto = FlxTilemap.STRING; bgMap3.indexOffset = -1; bgMap3.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "stars", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap3.boundingBoxOverride = false; bgMap3.setScrollFactors(0.5f, 0.5f); add(bgMap3); FlxTilemap bgMap4 = new FlxTilemap(); bgMap4.auto = FlxTilemap.STRING; bgMap4.indexOffset = -1; bgMap4.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "city", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap4.boundingBoxOverride = false; bgMap4.setScrollFactors(1, 1); add(bgMap4); follower = new FlxSprite(0, -100); follower.visible = false; add(follower); follower.velocity.Y = 450; FlxG.follow(follower, 20.0f); FlxG.followBounds(0, 0, int.MaxValue, 2000); FlxText text1 = new FlxText(0, FlxG.height / 2 - 50, FlxG.width, "Initials\nVideo\nGames\nPresents"); text1.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 2, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); text1.setScrollFactors(1.5f, 1.5f); add(text1); credits = new FlxText(0, FlxG.height / 2 - 100, FlxG.width, "A Game by\nShane Brouwer"); credits.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 2, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); credits.setScrollFactors(0, 0); credits.visible = false; add(credits); string ins = "Press X to Continue"; #if __ANDROID__ ins = "Press O to Continue"; #endif instruction = new FlxText(0, FlxG.height / 1.3f, FlxG.width, ins); instruction.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 2, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); instruction.setScrollFactors(0, 0); instruction.visible = false; add(instruction); tween = new Tweener(FlxG.height / 1.3f, FlxG.height / 1.2f, TimeSpan.FromSeconds(0.67f), XNATweener.Cubic.EaseInOut); tween.PingPong = true; tween.Start(); // play some music FlxG.playMp3("Lemonade/music/Beyond", 0.75f); rain = new FlxGroup(); for (int i = 0; i < 150; i++) { FlxSprite rainDrop = new FlxSprite((FlxU.random() * FlxG.width), -200 + (FlxU.random() * 1000)); rainDrop.loadGraphic("Lemonade/rain", true, false, 2, 2); rainDrop.frame = (int)FlxU.random(0, 6); rainDrop.velocity.Y = FlxU.random(350, 400); rain.add(rainDrop); } add(rain); splashes = new FlxEmitter(); splashes.createSprites("Lemonade/rain", 150, true, 0.0f, 0.0f); splashes.setXSpeed(-25, 25); splashes.setYSpeed(-30, 0); splashes.gravity = 1.0f; add(splashes); }
public void loadOgmo() { Console.WriteLine("Ogmo Loading level {0}", Globals.hole); Dictionary <string, string> ogmo = FlxXMLReader.readAttributesFromOelFile("putt/ogmo/hole" + Globals.hole.ToString() + ".oel", "level/roll"); rollTiles = new FlxTilemap(); rollTiles.loadMap(ogmo["roll"], FlxG.Content.Load <Texture2D>("putt/rollIndicators"), 8, 8); rollTiles.color = new Color(1, 1, 1, 0.8f); //add(rollTiles); // ------------------------------------ string[] cols; string[] rows = ogmo["roll"].Split('\n'); int heightInTiles = rows.Length; int r = 0; //int c; foreach (var item in rows) { int l = 0; cols = rows[r].Split(','); foreach (var x in cols) { if (x != "-1" && x != "-1\r") { //Console.WriteLine("Roll: {0}", x); RollIndicator roll = new RollIndicator(l * 8, r * 8, Convert.ToInt32(x)); add(roll); } l++; } r++; } List <Dictionary <string, string> > levelNodes = FlxXMLReader.readNodesFromOelFile("putt/ogmo/hole" + Globals.hole.ToString() + ".oel", "level/bg"); foreach (Dictionary <string, string> nodes in levelNodes) { //foreach (KeyValuePair<string, string> kvp in nodes) //{ // Console.Write("Key = {0}, Value = {1}, ", // kvp.Key, kvp.Value); //} //Console.Write("\r\n"); if (nodes["Name"] == "hole") { hole.reset(Convert.ToInt32(nodes["x"]), Convert.ToInt32(nodes["y"])); } } }
public override void create() { FlxG.Framerate = 50; //FlxG.FlashFramerate = 50; // set the background color to white FlxG.bgColor = FlxColor.WHITE; //Setup the level (40 x 40 tiles) Addapted from Adam Atomic's EZPlatformer int[] levelData = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; // Create the tilemap from the levelData we just created level = new FlxTilemap(); level.loadMap(FlxTilemap.arrayToCSV(levelData, 40), FlxTilemap.ImgAuto, 0, 0, FlxTilemap.AUTO); add(level); //Create the two players player1 = new FlxSprite(65, 200).makeGraphic(10, 12, FlxColor.RED); //player 1 is red and starts at 65, 200 player1.MaxVelocity.X = 80; // Theses are pysics settings, player1.MaxVelocity.Y = 200; // controling how the players behave player1.Acceleration.Y = 200; // in the game player1.Drag.X = player1.MaxVelocity.X * 4; add(player1); player2 = new FlxSprite(265, 200).makeGraphic(10, 12, FlxColor.BLUE); // player2 is blue and starts at 265, 200 player2.MaxVelocity.X = 80; // Same thing than player 1 player2.MaxVelocity.Y = 200; player2.Acceleration.Y = 200; player2.Drag.X = player2.MaxVelocity.X * 4; add(player2); // Then we setup two cameras to follow each of the two players FlxCamera cam = new FlxCamera(0, 0, FlxG.width / 2, FlxG.height); // we put the first one in the top left corner cam.follow(player2); // this sets the limits of where the camera goes so that it doesn't show what's outside of the tilemap cam.setBounds(0, 0, level.Width, level.Height); cam.Color = FlxColor.PINK; // add a light red tint to the camera to differentiate it from the other FlxG.resetCameras(cam); // Almost the same thing as the first camera cam = new FlxCamera(FlxG.width / 2, 0, FlxG.width / 2, FlxG.height); // and the second one in the top middle of the screen cam.follow(player1); cam.setBounds(0, 0, level.Width, level.Height); cam.Color = FlxColor.CADETBLUE; // Add a light blue tint to the camera FlxG.addCamera(cam); }
override public void create() { base.create(); // play some music FlxG.playMp3("Lemonade/music/music_menu_1", 0.75f); // load some tile maps List <Dictionary <string, string> > bgString = FlxXMLReader.readNodesFromTmxFile("Lemonade/levels/slf2/newyork/bgnewyork.tmx", "map", "bg", FlxXMLReader.TILES); ny = new FlxTilemap(); ny.auto = FlxTilemap.STRING; ny.indexOffset = -1; ny.loadMap(bgString[0]["csvData"], FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); ny.boundingBoxOverride = true; ny.setScrollFactors(0, 0); ny.visible = false; add(ny); bgString = FlxXMLReader.readNodesFromTmxFile("Lemonade/levels/slf2/sydney/bgsydney.tmx", "map", "bg", FlxXMLReader.TILES); sydney = new FlxTilemap(); sydney.auto = FlxTilemap.STRING; sydney.indexOffset = -1; sydney.loadMap(bgString[0]["csvData"], FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_sydney"), 20, 20); sydney.boundingBoxOverride = true; sydney.setScrollFactors(0, 0); sydney.visible = false; add(sydney); bgString = FlxXMLReader.readNodesFromTmxFile("Lemonade/levels/slf2/military/bgmilitary.tmx", "map", "bg", FlxXMLReader.TILES); miltary = new FlxTilemap(); miltary.auto = FlxTilemap.STRING; miltary.indexOffset = -1; miltary.loadMap(bgString[0]["csvData"], FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_military"), 20, 20); miltary.boundingBoxOverride = true; miltary.setScrollFactors(0, 0); miltary.visible = false; add(miltary); //FlxG.mouse.show(FlxG.Content.Load<Texture2D>("Mode/cursor")); FlxButton b = new FlxButton((FlxG.width / 2) - 100, 150, startGame); b.loadGraphic(new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/button_ny")), new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/buttonPressed_ny"))); b.loadText(new FlxText(-20, 10, 100, "Sydney"), new FlxText(-20, 10, 100, "Sydney!")); buttons.add(b); b = new FlxButton(FlxG.width / 2, 150, startGame); b.loadGraphic(new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/button_ny")), new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/buttonPressed_ny"))); b.loadText(new FlxText(-20, 10, 100, "New York"), new FlxText(-20, 10, 100, "New York!")); buttons.add(b); b = new FlxButton((FlxG.width / 2) + 100, 150, startGame); b.loadGraphic(new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/button_ny")), new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/buttonPressed_ny"))); b.loadText(new FlxText(-20, 10, 100, "Military"), new FlxText(-20, 10, 100, "Military!")); buttons.add(b); for (int i = 1; i < 13; i++) { FlxButton a = new FlxButton(175 + (i * 45), 225, startGame); a.loadGraphic(new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/button_ny")), new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/buttonPressed_ny"))); a.loadText(new FlxText(-40, 10, 100, i.ToString()), new FlxText(-40, 10, 100, i.ToString() + "!")); buttons.add(a); } b = new FlxButton((FlxG.width / 2) - 100, 275, startMultiplayerGame); b.loadGraphic(new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/button_ny")), new FlxSprite().loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/buttonPressed_ny"))); b.loadText(new FlxText(-20, 10, 100, "Multiplayer"), new FlxText(-20, 10, 100, "Multiplayer!")); buttons.add(b); location = new FlxText(0, 50, FlxG.width); location.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 3, Color.White, FlxJustification.Center, Color.Black); location.text = ""; add(location); addButtons(); FlxText badges = new FlxText(0, 330, 0, "Badges"); badges.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 3, Color.White, FlxJustification.Left, Color.Black); add(badges); Color notDone = new Color(0.1f, 0.1f, 0.1f); badge1 = new FlxSprite((FlxG.width / 2) - 150, 330); badge1.loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/offscreenIcons"), true, false, 12, 12); badge1.frame = 2; badge1.color = notDone; add(badge1); badge2 = new FlxSprite((FlxG.width / 2) - 50, 330); badge2.loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/offscreenIcons"), true, false, 12, 12); badge2.frame = 3; badge2.color = notDone; add(badge2); badge3 = new FlxSprite((FlxG.width / 2) + 50, 330); badge3.loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/offscreenIcons"), true, false, 12, 12); badge3.frame = 4; badge3.color = notDone; add(badge3); badge4 = new FlxSprite((FlxG.width / 2) + 150, 330); badge4.loadGraphic(FlxG.Content.Load <Texture2D>("Lemonade/offscreenIcons"), true, false, 12, 12); badge4.frame = 5; badge4.color = notDone; add(badge4); tweenBounce = new Tweener(5.0f, 8.0f, TimeSpan.FromSeconds(1.12f), Elastic.EaseOut); tweenBounce.PingPong = true; try { FlxG.username = LoadFromDevice(); } catch { Console.WriteLine("Cannot load name from file"); } if (FlxG.username != "") { //_nameEntry.text = FlxG.username; FlxG.setHudText(3, "Username:\n" + FlxG.username); FlxG.setHudTextPosition(3, 50, FlxG.height - 30); FlxG.setHudTextScale(3, 2); } }
override public void create() { base.create(); #if __ANDROID__ FlxG.BUILD_TYPE = FlxG.BUILD_TYPE_OUYA; #endif FlxTilemap bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "bg", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(1, 1); add(bgMap); bgMap = new FlxTilemap(); bgMap.auto = FlxTilemap.STRING; bgMap.indexOffset = -1; bgMap.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "bg2", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap.boundingBoxOverride = false; bgMap.setScrollFactors(1, 1); add(bgMap); FlxTilemap bgMap3 = new FlxTilemap(); bgMap3.auto = FlxTilemap.STRING; bgMap3.indexOffset = -1; bgMap3.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "stars", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap3.boundingBoxOverride = false; bgMap3.setScrollFactors(0.5f, 0.5f); add(bgMap3); FlxTilemap bgMap4 = new FlxTilemap(); bgMap4.auto = FlxTilemap.STRING; bgMap4.indexOffset = -1; bgMap4.loadTMXMap("Lemonade/levels/slf2/newyork/newyork_intro.tmx", "map", "city", FlxXMLReader.TILES, FlxG.Content.Load <Texture2D>("Lemonade/bgtiles_newyork"), 20, 20); bgMap4.boundingBoxOverride = false; bgMap4.setScrollFactors(1, 1); add(bgMap4); follower = new FlxSprite(0, -100); follower.visible = false; add(follower); follower.velocity.Y = 1450; follower.drag.Y = 10; FlxG.follow(follower, 20.0f); FlxG.followBounds(0, 0, int.MaxValue, 2000); FlxText text1 = new FlxText(0, FlxG.height / 2 - 50, FlxG.width, "GAME OVER"); text1.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 2, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); text1.setScrollFactors(1.5f, 1.5f); add(text1); string howWellDidYouGo = "Collected " + Lemonade_Globals.coins.ToString() + " from " + Lemonade_Globals.totalCoins.ToString() + " Coins "; credits = new FlxText(0, FlxG.height / 2 - 100, FlxG.width, ""); credits.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 2, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); credits.setScrollFactors(0, 0); credits.visible = true; add(credits); string ins = "Press X to Continue"; #if __ANDROID__ ins = "Press O to Continue"; #endif instruction = new FlxText(0, FlxG.height / 1.3f, FlxG.width, ins); instruction.setFormat(FlxG.Content.Load <SpriteFont>("Lemonade/SMALL_PIXEL"), 2, Lemonade_Globals.GAMEBOY_COLOR_4, FlxJustification.Center, Lemonade_Globals.GAMEBOY_COLOR_1); instruction.setScrollFactors(0, 0); instruction.visible = true; add(instruction); //rgb(237, 0, 142) tween = new Tweener(FlxG.height / 1.3f, FlxG.height / 1.2f, TimeSpan.FromSeconds(1.0f), XNATweener.Cubic.EaseInOut); tween.PingPong = true; tween.Start(); // play some music FlxG.playMp3("Lemonade/music/Lemonade1989Theme", 0.75f); FlxG.play("Lemonade/sfx/cw_sound15", 0.5f, false); }