Пример #1
0
        public void activateCockpit()
        {
            filled = true;
            entity.frame.useOffset = false;
            entity.frame.setChexel(pos.x, pos.y, new Chexel('@'));
            entity.frame.useOffset = true;
            CameraCComponent camera = new CameraCComponent();

            camera.controllable = false;
            camera.hasMoved     = true;
            entity.AddComponent(camera);
        }
Пример #2
0
        public static void engineTestSetup()
        {
            Entity pc = new Entity(new Vec3(0, 0, 0), 0);

            pc.AddComponent(new CameraComponent());
            worldManager.addEntity(pc);

            SolarSystem.SolarSystem solarSystem = new SolarSystem.SolarSystem(800);
            for (int i = 0; i < solarSystem.numPlanets; i++)
            {
                worldManager.addEntity(solarSystem.planets[i].entity);
            }

            ChexelEntity pcT = new ChexelEntity(new vector2(60, 228), ConsoleColor.White, '@');

            pcT.AddComponent(new CameraCComponent());
            tileMapManager.addEntity(pcT);

            string[] rocket =
            {
                "     /\\ ",
                "    |==| ",
                "    |  | ",
                "    |  | ",
                "    |  | ",
                "   /____\\ ",
                "   |    | ",
                "   |    | ",
                "   |    | ",
                "   |    | ",
                "  /| |  |\\ ",
                " / | |  | \\ ",
                "/__|_|__|__\\ ",
                "   /_\\/_\\ "
            };

            FrameEntity rocketShip = new FrameEntity(new vector2(54, 2), ConsoleColor.White, ' ', Frame.FromStringArray(rocket, ConsoleColor.Black, ConsoleColor.Green));

            rocketShip.AddComponent(new CockpitCComponent());
            tileMapManager.addFrameEntity(rocketShip);

            FrameEntity rocketExhaust = new FrameEntity(new vector2(rocketShip.pos.x, rocketShip.pos.y + rocket.Length), ConsoleColor.White, ' ', new Frame(12, 8, 0, 0));

            rocketExhaust.AddComponent(new FollowEndCComponent(rocketShip));
            rocketExhaust.frame.shader    = new FireShader(rocketExhaust.frame);
            rocketExhaust.frame.hasShader = true;
            tileMapManager.addFrameEntity(rocketExhaust);
        }