Exemplo n.º 1
0
        override public void create()
        {
            FlxG.backColor = Color.DarkBlue;



            base.create();


            FlxG.resetHud();


            string textInfo = "";

            textInfo  = "Choose:\n";
            textInfo += "1. Camera Test State\n";
            textInfo += "2. Cave Tiles Test State\n";


            FlxG.setHudText(1, textInfo);
            FlxG.setHudTextPosition(1, 20, 20);
            FlxG.setHudTextScale(1, 3);
            FlxG.setHudGamepadButton(FlxHud.TYPE_KEYBOARD, FlxHud.Keyboard_1, FlxG.width - 40, 30);

            FlxG.showHud();
        }
Exemplo n.º 2
0
        override public void create()
        {
            base.create();

            FlxG.showHud();
            FlxG.setHudText(1, "Press [`] to show the debug console.\nYou must build with the Debug Solution Configuration.\n\nIn the console press TAB to bring up the cheat menu.\n\nTry typing in the cheat code \"cheatcode\"");
            FlxG.setHudGamepadButton(FlxHud.TYPE_KEYBOARD, FlxHud.Keyboard_Tilda, (FlxG.width * 2) - 100, 10);
            FlxG.setHudGamepadButton(FlxHud.TYPE_KEYBOARD_DIRECTION, FlxHud.Keyboard_Tab, (FlxG.width * 2) - 100, 100);
        }
Exemplo n.º 3
0
        override public void create()
        {
            base.create();

            FlxG.mouse.show(FlxG.Content.Load <Texture2D>("flixel/cursor"));

            mouseInfo           = new FlxText(1, 1, 100);
            mouseInfo.text      = "Info:";
            mouseInfo.alignment = FlxJustification.Left;
            mouseInfo.setScrollFactors(1, 1);
            add(mouseInfo);

            FlxG.resetHud();

            string textInfo = "";

            textInfo  = "Choose:\n";
            textInfo += "1. Cheat State\n";
            textInfo += "2. Cave State\n";
            textInfo += "3. Race Or Die\n";
            textInfo += "4. Tweens\n";
            textInfo += "5. Robot Football\n";
            textInfo += "6. Animation Callbacks\n";
            textInfo += "7. FlxPath \n";
            textInfo += "8. Physics \n";
            textInfo += "9. Angle And Velocity\n";
            textInfo += "F2. Physics 2\n";
            textInfo += "F3. Island \n";
            textInfo += "F4. Island 2 \n";
            textInfo += "F5. Physics Hockey \n";
            textInfo += "F6. FlxBar \n";
            textInfo += "F7. Scrolling Test \n";

            textInfo += "Q. Garbage Tests \n";
            FlxG.setHudText(1, textInfo);
            FlxG.setHudTextPosition(1, 50, 20);
            FlxG.setHudTextScale(1, 2);
            FlxG.setHudGamepadButton(FlxHud.TYPE_KEYBOARD, FlxHud.Keyboard_1, FlxG.width - 120, 30);

            FlxG.showHud();

            /*
             *          FlxSprite logo = new FlxSprite(12, 12);
             *          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);
             */
        }
Exemplo n.º 4
0
        //PlayHud localHud;

        override public void create()
        {
            FlxG.backColor = Color.Black;

            base.create();

            FlxG.mouse.show(FlxG.Content.Load <Texture2D>("initials/crosshair"));

            //FlxG.backColor = new Color(0xc2, 0x88, 0x83);

            base.create();

            FlxG.resetHud();
            FlxG.showHud();

            _nameEntry = new FlxText(60, 150, FlxG.width);
            _nameEntry.setFormat(null, 2, Color.White, FlxJustification.Left, Color.White);
            _nameEntry.text = "";
            add(_nameEntry);

            try
            {
                _nameEntry.text = LoadFromDevice();
            }
            catch
            {
                Console.WriteLine("Cannot load name from file");
            }

            FlxG.showHud();
            FlxG.setHudText(1, "Enter name, use @ symbol to specify Twitter handle.\nPress enter when complete.");
            FlxG.setHudTextScale(1, 2);
            FlxG.setHudTextScale(3, 2);
            FlxG.setHudTextPosition(1, 30 * 2, 40 * 2);
            FlxG.setHudTextPosition(3, 10 * 2, 20 * 2);

            //play = new FlxButton(FlxG.width / 2 - 50, FlxG.height - 30, advanceToNextState, FlxButton.ControlPadA);
            ////play = new FlxButton(0, FlxG.height - 30, advanceToNextState, FlxButton.ControlPadA);

            //play.loadGraphic((new FlxSprite()).loadGraphic(FlxG.Content.Load<Texture2D>("fourchambers/menuButton"), false, false, 100, 20), (new FlxSprite()).loadGraphic(FlxG.Content.Load<Texture2D>("fourchambers/menuButtonPressed"), false, false, 100, 20));

            //play.loadText(new FlxText(2, 2, 100, "Enter"), new FlxText(2, 2, 100, "ENTER"));
            //add(play);

            FlxG.setHudGamepadButton(FlxHud.TYPE_XBOX, FlxButton.ControlPadA, FlxG.width / 2 + 54, FlxG.height - 100);

            FlxG.flash.start(Color.Black, 1.5f);
        }
Exemplo n.º 5
0
        override public void create()
        {
            base.create();

            FlxG.setHudGamepadButton(FlxHud.TYPE_KEYBOARD, FlxHud.Keyboard_Arrow_Left, 10, 110);
            FlxG.setHudGamepadButton(FlxHud.TYPE_KEYBOARD_DIRECTION, FlxHud.Keyboard_Arrow_Right, 110, 110);



            FlxSprite bg = new FlxSprite(0, 0);

            bg.createGraphic(FlxG.width, FlxG.width, new Color(0.05f, 0.05f, 0.08f));
            bg.setScrollFactors(0, 0);
            add(bg);

            stars = new FlxGroup();


            // Make a starfield to fly through.
            for (int i = 0; i < 100; i++)
            {
                star = new FlxSprite(FlxU.random(0, FlxG.width), FlxU.random(0, FlxG.height));
                star.createGraphic(3, 3, Color.White);
                star.velocity.Y = FlxU.random(20, 100);
                star.velocity.X = 0;
                stars.add(star);
            }

            add(stars);

            spaceShip = new FlxSprite(FlxG.width / 2, FlxG.height / 2);
            spaceShip.loadGraphic(FlxG.Content.Load <Texture2D>("flixel/surt/spaceship_32x32"), true, false, 32, 32);

            //Add some animations to our Spaceship
            spaceShip.addAnimation("static", new int[] { 0 }, 36, true);

            spaceShip.addAnimation("transform1", new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }, 12, false);
            spaceShip.addAnimation("transform2", new int[] { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 }, 12, false);
            spaceShip.addAnimation("transform3", new int[] { 40, 41, 42 }, 12, false);


            //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}, 24, false);
            //spaceShip.addAnimation("reverse", 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 }, 24, false);

            spaceShip.addAnimation("transform", spaceShip.generateFrameNumbersBetween(0, 39), 24, false);
            spaceShip.addAnimation("reverse", spaceShip.generateFrameNumbersBetween(39, 0), 24, false);

            spaceShip.play("static");

            //Add an animation callback - This will call Pulse on every frame.
            spaceShip.addAnimationCallback(pulse);

            spaceShip.scale = 3;
            spaceShip.setDrags(1100, 1100);
            add(spaceShip);

            jets = new FlxEmitter();

            jets.setSize(5, 50);
            jets.createSprites(FlxG.Content.Load <Texture2D>("flixel/diagnostic/testpalette"), 100, true, 0.0f, 0.0f);
            jets.setXSpeed(-110, 110);
            jets.setYSpeed(40, 80);

            add(jets);
            jets.at(spaceShip);
        }