コード例 #1
0
ファイル: PlayerController.cs プロジェクト: MattDBell/GCubed
 public override void Init(ContentManager content)
 {
     base.Init(content);
     //Better would be to give it a handle to the texture, but this works for now
     m_tex = content.Load<Texture2D>("dude");
     transform.SetMaxSpeed(100.0f);
     myComp = CollisionManager.Get().GetCollComponent();
     zCollisionCircle prim = new zCollisionCircle(Vector2.Zero, 5.0f);
     myComp.AddPrimitive(prim);
     myComp.SetTransform(transform);
     myComp.SetCallBack(PhysicsCallback);
     rayCast = CollisionManager.Get().GetCollComponent();
     //zCollisionLine line = new zCollisionLine(Vector2.Zero, new Vector2(0, -1));
     //rayCast.AddPrimitive(line);
     rayCast.SetTransform(transform);
     rayCast.SetCallBack(RayCastCallBack);
 }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: MattDBell/GCubed
        public override void Init(ContentManager content)
        {
            base.Init(content);
            //Better would be to give it a handle to the texture, but this works for now
            m_tex = content.Load <Texture2D>("dude");
            transform.SetMaxSpeed(100.0f);
            myComp = CollisionManager.Get().GetCollComponent();
            zCollisionCircle prim = new zCollisionCircle(Vector2.Zero, 5.0f);

            myComp.AddPrimitive(prim);
            myComp.SetTransform(transform);
            myComp.SetCallBack(PhysicsCallback);
            rayCast = CollisionManager.Get().GetCollComponent();
            //zCollisionLine line = new zCollisionLine(Vector2.Zero, new Vector2(0, -1));
            //rayCast.AddPrimitive(line);
            rayCast.SetTransform(transform);
            rayCast.SetCallBack(RayCastCallBack);
        }