コード例 #1
0
ファイル: Program.cs プロジェクト: NullandKale/CRT
        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);
        }
コード例 #2
0
 public void start(ChexelEntity e)
 {
     follow = e;
 }
コード例 #3
0
ファイル: CameraCComponent.cs プロジェクト: NullandKale/CRT
 public void start(ChexelEntity e)
 {
     follow = e;
     Program.tileMapManager.centerOnCell(follow.pos);
 }
コード例 #4
0
 public void start(ChexelEntity e)
 {
     entity = (FrameEntity)e;
 }