Пример #1
0
        override public void create()
        {
            FlxG.resetHud();
            FlxG.showHud();

            FlxG.backColor = Color.LightGray;

            base.create();

            string levelData = FlxU.randomString(10);

            FlxG.log("levelData: " + levelData);

            makeCave(0.1f, Color.Black);
            makeCave(0.5f, new Color(0.98f, 1.0f, 0.95f));
            makeCave2(1.0f, Color.Green);

            spaceShip = new FlxSprite(60, 60);
            spaceShip.loadGraphic(FlxG.Content.Load <Texture2D>("flixel/surt/spaceship_32x32"), true, false, 32, 32);
            spaceShip.addAnimation("Static", new int[] { 0 }, 36, true);
            spaceShip.addAnimation("Transform", new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 }, 36, false);
            spaceShip.play("Static");

            spaceShip.setDrags(1100, 1100);
            add(spaceShip);

            FlxG.follow(spaceShip, 10.0f);
            FlxG.followBounds(0, 0, 50 * 16, 40 * 16);
        }
Пример #2
0
        override public void create()
        {
            FlxG.hideHud();

            FlxG.backColor = Color.LightGray;

            base.create();

            makeCave2(1.0f, Color.Green);

            logo = new FlxSprite(360, 360);
            logo.loadGraphic("flixel/surt/race_or_die", true, false, 64, 64);
            logo.addAnimation("Static", new int[] { 8 }, 0, true);
            logo.play("Static");

            logo.setDrags(5, 5);
            add(logo);

            FlxG.follow(logo, 10.0f);
            FlxG.followBounds(0, 0, 150 * 16, 140 * 16);

            velValue = 0;
        }
Пример #3
0
        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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,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,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\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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        override public void create()
        {
            base.create();

            FlxG.resetHud();

            makeCave(1.0f, Color.White);

            FlxSprite avatar = new FlxSprite(0, FlxG.height - 64);

            avatar.loadGraphic(FlxG.Content.Load <Texture2D>("flixel/surt/race_or_die"), true, false, 64, 64);
            avatar.addAnimation("Static", new int[] { 2 }, 0, true);
            avatar.play("Static");
            avatar.setScrollFactors(0, 0);

            add(avatar);

            p = new FlxPath(null);
            addPathPointWithMarker(40.0f, 40.0f, 0);
            addPathPointWithMarker(522.67800098f, 342.106739267f, 1);
            addPathPointWithMarker(582.8467536f, 603.25142048f, 2);
            addPathPointWithMarker(531.13384868f, 263.27163512f, 3);
            addPathPointWithMarker(1447.02681801f, 449.15789055f, 4);
            addPathPointWithMarker(1201.74908191f, 528.33347167f, 5);
            addPathPointWithMarker(147.07640576f, 672.46462447f, 6);
            addPathPointWithMarker(199.62346884f, 584.58110087f, 7);
            addPathPointWithMarker(108.19931517f, 355.52333218f, 8);
            addPathPointWithMarker(698.584671041f, 174.70156601f, 9);

            for (int i = 0; i < 9; i++)
            {
                FlxLine line = new FlxLine(0, 0, new Vector2(p.nodes[i].X, p.nodes[i].Y), new Vector2(p.nodes[i + 1].X, p.nodes[i + 1].Y), Color.White, 2);
                add(line);
            }

            car = new FlxSprite(40, 40);
            car.loadGraphic(FlxG.Content.Load <Texture2D>("flixel/surt/race_or_die"), true, false, 64, 64);
            //car.addAnimation("Static", new int[] { 8 }, 0, true);
            //car.play("Static");
            car.frame = 8;
            car.setDrags(5, 5);
            add(car);

            car.path            = p;
            car.pathCornering   = 5.0f;
            car.pathAngleOffset = 180;
            //car.pathSpeed = 500.0f;
            car.followPath(p, 250.0f, FlxSprite.PATH_LOOP_FORWARD, true);

            FlxG.follow(car, 5.0f);
            FlxG.followBounds(0, 0, 100 * 16, 100 * 16);


            for (int i = 0; i < 7; i++)
            {
                p = new FlxPath(null);
                p.add(40.0f, 40.0f);
                p.add(522.67800098f + FlxU.random(1, 100), 342.106739267f + FlxU.random(1, 100));
                p.add(582.8467536f, 603.25142048f + FlxU.random(1, 1200));
                p.add(531.13384868f, 263.27163512f + FlxU.random(1, 1200));
                p.add(1447.02681801f, 449.15789055f + FlxU.random(1, 1200));
                p.add(1201.74908191f, 528.33347167f + FlxU.random(1, 1200));
                p.add(147.07640576f, 672.46462447f + FlxU.random(1, 1200));
                p.add(199.62346884f, 584.58110087f + FlxU.random(1, 1200));
                p.add(108.19931517f, 355.52333218f + FlxU.random(1, 1200));
                p.add(698.584671041f, 174.70156601f + FlxU.random(1, 2100));


                car = new FlxSprite(40, 40);
                car.loadGraphic(FlxG.Content.Load <Texture2D>("flixel/surt/race_or_die"), true, false, 64, 64);
                //car.addAnimation("Static", new int[] { 8 }, 0, true);
                //car.play("Static");
                car.frame = 6 + i;
                car.setDrags(5, 5);
                add(car);

                car.path            = p;
                car.pathCornering   = 5.0f;
                car.pathAngleOffset = 180;
                //car.pathSpeed = 500.0f;
                car.followPath(p, 50.0f + (i * 30), FlxSprite.PATH_LOOP_FORWARD, true);
            }
        }
        override public void create()
        {
            base.create();

            Lemonade_Globals.coinsThisLevel = 0;

            Console.WriteLine("Starting Level {0} : {1}", FlxG.level, Lemonade_Globals.location);
            FlxG.transition.resetAndStop();


            FlxG._game.hud.p1HudText.x = -1000;
            FlxG._game.hud.p2HudText.x = -1000;
            FlxG._game.hud.p3HudText.x = -1000;
            FlxG._game.hud.p4HudText.x = -1000;

            FlxG._game.hud.setHudGamepadButton(FlxHud.TYPE_KEYBOARD, 0, -1000, -1000);

            FlxG.mouse.hide();

            FlxG.autoHandlePause = true;

            actors               = new FlxGroup();
            trampolines          = new FlxGroup();
            levelItems           = new FlxGroup();
            ramps                = new FlxGroup();
            smallCrates          = new FlxGroup();
            movingPlatforms      = new FlxGroup();
            hazards              = new FlxGroup();
            collidableTileblocks = new FlxGroup();
            coins                = new FlxGroup();


            //Level Adjust

            buildTileset();
            buildActors();
            buildBoxes();

            add(trampolines);
            add(levelItems);

            add(ramps);
            add(smallCrates);
            add(movingPlatforms);
            add(actors);
            add(collidableTileblocks);

            add(hazards);
            add(coins);



            //set up a little bubble particle system.

            bubbleParticle       = new FlxEmitter();
            bubbleParticle.delay = 3;
            bubbleParticle.setXSpeed(-150, 150);
            bubbleParticle.setYSpeed(-40, 100);
            bubbleParticle.setRotation(-720, 720);
            bubbleParticle.gravity = Lemonade_Globals.GRAVITY * -0.25f;
            bubbleParticle.createSprites(FlxG.Content.Load <Texture2D>("Lemonade/bubble"), 200, true, 1.0f, 0.65f);
            add(bubbleParticle);

            crateParticle       = new FlxEmitter();
            crateParticle.delay = float.MaxValue;
            crateParticle.setSize(80, 60);
            crateParticle.setXSpeed(-350, 350);
            crateParticle.setYSpeed(-200, 200);
            crateParticle.setRotation(-720, 720);
            crateParticle.gravity = Lemonade_Globals.GRAVITY;
            crateParticle.createSprites(FlxG.Content.Load <Texture2D>("Lemonade/crateShards"), 200, true, 1.0f, 0.65f);
            add(crateParticle);


            // follow.
            FlxG.followBounds(0, 0, FlxG.levelWidth, FlxG.levelHeight);

            if (Lemonade_Globals.location == "factory")
            {
                FlxG.follow(worker, LERP);
            }
            if (Lemonade_Globals.location == "management")
            {
                FlxG.follow(liselot, LERP);
            }
            if (Lemonade_Globals.location == "military")
            {
                FlxG.follow(army, LERP);
            }
            if (Lemonade_Globals.location == "newyork")
            {
                FlxG.follow(chef, LERP);
            }
            if (Lemonade_Globals.location == "warehouse")
            {
                FlxG.follow(andre, LERP);
            }
            if (Lemonade_Globals.location == "sydney")
            {
                FlxG.follow(inspector, LERP);
            }

            playSong();

            currentCharHud = new Hud(5, 5);
            add(currentCharHud);

            levelIntro = new LevelIntro();
            add(levelIntro);

            currentCharHud.time = Lemonade_Globals.timeLeft;

            foreach (FlxSprite item in actors.members)
            {
                if (Lemonade_Globals.stateSaver[Lemonade_Globals.location].ContainsKey(item.ToString()))
                {
                    try
                    {
                        item.x = Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString()].X;
                        item.y = Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString()].Y;
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("State saver not working for actors.");
                    }
                }
            }
            int count = 0;

            foreach (FlxSprite item in coins.members)
            {
                if (Lemonade_Globals.stateSaver[Lemonade_Globals.location].ContainsKey(item.ToString() + count.ToString()))
                {
                    try
                    {
                        //Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString() + count.ToString()] = new Vector2(item.x, item.y);
                        if (item.ToString().StartsWith("Lemonade.Coin"))
                        {
                            //item.x = Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString() + count.ToString()].X;
                            //item.y = Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString() + count.ToString()].Y;
                            item.dead = Convert.ToBoolean(Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString() + count.ToString()].X);

                            if (Convert.ToBoolean(Lemonade_Globals.stateSaver[Lemonade_Globals.location][item.ToString() + count.ToString()].X))
                            {
                                item.x = -100;
                                item.y = -100;
                            }
                        }

                        count++;
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("State saver not working for coins");
                    }
                }
            }
        }
        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);
        }
Пример #9
0
        override public void create()
        {
            FlxG.resetHud();
            FlxG.hideHud();

            FlxG.backColor = FlxColor.ToColor("#3cbcfc");

            base.create();

            FlxCaveGeneratorExt caveExt = new FlxCaveGeneratorExt(40, 40, 0.514f, 2);

            string[,] caveLevel = caveExt.generateCaveLevel();

            //Optional step to print cave to the console.
            //caveExt.printCave(caveLevel);
            #region color

            Color[] colors = new Color[] {
                FlxColor.ToColor("#7C7C7C"),

                FlxColor.ToColor("#0000FC"),

                FlxColor.ToColor("#0000BC"),

                FlxColor.ToColor("#4428BC"),

                FlxColor.ToColor("#940084"),

                FlxColor.ToColor("#A80020"),

                FlxColor.ToColor("#A81000"),

                FlxColor.ToColor("#881400"),

                FlxColor.ToColor("#503000"),

                FlxColor.ToColor("#007800"),

                FlxColor.ToColor("#006800"),

                FlxColor.ToColor("#005800"),

                FlxColor.ToColor("#004058"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#BCBCBC"),

                FlxColor.ToColor("#0078F8"),

                FlxColor.ToColor("#0058F8"),

                FlxColor.ToColor("#6844FC"),

                FlxColor.ToColor("#D800CC"),

                FlxColor.ToColor("#E40058"),

                FlxColor.ToColor("#F83800"),

                FlxColor.ToColor("#E45C10"),

                FlxColor.ToColor("#AC7C00"),

                FlxColor.ToColor("#00B800"),

                FlxColor.ToColor("#00A800"),

                FlxColor.ToColor("#00A844"),

                FlxColor.ToColor("#008888"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#F8F8F8"),

                FlxColor.ToColor("#3CBCFC"),

                FlxColor.ToColor("#6888FC"),

                FlxColor.ToColor("#9878F8"),

                FlxColor.ToColor("#F878F8"),

                FlxColor.ToColor("#F85898"),

                FlxColor.ToColor("#F87858"),

                FlxColor.ToColor("#FCA044"),

                FlxColor.ToColor("#F8B800"),

                FlxColor.ToColor("#B8F818"),

                FlxColor.ToColor("#58D854"),

                FlxColor.ToColor("#58F898"),

                FlxColor.ToColor("#00E8D8"),

                FlxColor.ToColor("#787878"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#FCFCFC"),

                FlxColor.ToColor("#A4E4FC"),

                FlxColor.ToColor("#B8B8F8"),

                FlxColor.ToColor("#D8B8F8"),

                FlxColor.ToColor("#F8B8F8"),

                FlxColor.ToColor("#F8A4C0"),

                FlxColor.ToColor("#F0D0B0"),

                FlxColor.ToColor("#FCE0A8"),

                FlxColor.ToColor("#F8D878"),

                FlxColor.ToColor("#D8F878"),

                FlxColor.ToColor("#B8F8B8"),

                FlxColor.ToColor("#B8F8D8"),

                FlxColor.ToColor("#00FCFC"),

                FlxColor.ToColor("#F8D8F8"),

                FlxColor.ToColor("#000000"),

                FlxColor.ToColor("#000000")
            };

            #endregion

            tileGrp  = new FlxGroup();
            waterGrp = new FlxGroup();
            pellets  = new FlxGroup();

            Vector2 startPos = new Vector2(0, 0);

            for (int i = 0; i < caveLevel.GetLength(1); i++)
            {
                for (int y = 0; y < caveLevel.GetLength(0); y++)
                {
                    //string toPrint = tiles[y, i];
                    if (Convert.ToInt32(caveLevel[y, i]) != 0)
                    {
                        if (startPos.X == 0)
                        {
                            startPos = new Vector2(i * 8, y * 8);
                        }
                        FlxSprite x = new FlxSprite(i * 8, y * 8);
                        //x.createGraphic(8, 8, colors[Convert.ToInt32(caveLevel[y, i])]);
                        x.loadGraphic("autotilesIsland", false, false, 8, 8);
                        //x.color = colors[Convert.ToInt32(caveLevel[y, i])];

                        x.frame = Convert.ToInt32(caveLevel[y, i]);
                        //x.scale = 2;
                        //x.angularDrag = 250;
                        //x.setOffset(4, 4);
                        tileGrp.add(x);

                        if (FlxU.random() < 0.02f)
                        {
                            FlxSprite xx = new FlxSprite(i * 8, y * 8);
                            xx.createGraphic(8, 8, Color.Red);
                            pellets.add(xx);
                        }
                    }
                    else
                    {
                        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");

                        waterGrp.add(x);
                    }
                    //Console.Write(toPrint);
                }

                //Console.WriteLine();
            }

            //string newMap = caveExt.convertMultiArrayStringToString(caveLevel);


            add(tileGrp);
            add(waterGrp);
            add(pellets);

            //m = new FlxSprite(0, 0);
            //m.loadGraphic("flixel/cursor");
            //add(m);

            shadow = new FlxSprite(startPos.X, startPos.Y);
            shadow.createGraphic(8, 8, Color.Black);
            shadow.debugName = "onground";
            shadow.alpha     = 0.5f;
            add(shadow);

            player = new FlxSprite(startPos.X, startPos.Y);
            player.createGraphic(8, 8, colors[12]);
            add(player);

            //FlxG.showHud();

            FlxG.follow(shadow, 20.0f);
            FlxG.followBounds(0, 0, 320, 320);
        }