예제 #1
0
        public override void EnterScene()
        {
            var cf = new ContainerFactory((GameContainer g) =>
            {
                g.AddComponent(new Player(g));
                g.AddComponent(new DisablePlayer(g));
                g.AddComponent(new MeshRenderer(g, "fighter.x"));
                var col = new RectCollider(g, (Collider c) => { return; });
                col.Width = 10.0f;
                col.Height = 10.0f;
                g.AddComponent(col);
            });

            var cameraFactory = new ContainerFactory((GameContainer g) =>
            {
                g.AddComponent(new Camera(g));

            });

            var gc = cf.Create();
            Player player = gc.GetComponent<Player>();

            var fact = new ContainerFactory((GameContainer g) =>
            {
                var a = new RectCollider(g, (Collider c) => { DX.DrawString(0, 0, "HIT", DX.GetColor(255, 255, 255)); });
                a.Width = 10.0f;
                a.Height = 10.0f;
                g.AddComponent(a);
                g.Position.LocalPosition = new Vector3 { x = 50.0f, y = 50.0f, z = 0.0f };
            });
            fact.Create();

            var ec = new GameContainer();
            ec.AddComponent(new EnemyController(ec, player, new ScoreComponent(ec)));

            var camera = cameraFactory.Create().GetComponent<Camera>();
            camera.Position.LocalPosition = new Vector3 { x = 0.0f, y = 0.0f, z = -1000.0f };
            camera.FieldOfView = (float)Math.PI * 0.1f;

            var explosion = new GameContainer();
            explosion.Name = "Explosion";

            var sf = new ContainerFactory((GameContainer g) =>
            {
                var gcom = new Stage(g);
                g.AddComponent(gcom);
                g.AddComponent(new StageTimeline(g, gcom));
                g.AddComponent(new MeshRenderer(g, "hogeStage.x"));
                g.AddComponent(new MusicPlayer(g, "The Ray of Hopes (ver. seeing true sky).wav"));
            });

            sf.Create();
        }
예제 #2
0
파일: Stage.cs 프로젝트: himeiyuna/Raysist
 /// <summary>
 /// @brief コンストラクタ
 /// </summary>
 /// <param name="container"></param>
 /// <param name="s"></param>
 public StageTimeline(GameContainer container, Stage s)
     : base(container, "stage.csv")
 {
     Parent = s;
 }