コード例 #1
0
ファイル: GameEngine.cs プロジェクト: kjin/ribbon_gameplay
        /// <summary>
        /// Perform any initialization necessary before running the game.  This
        /// includes both (preliminary) model and view creation.
        /// </summary>
        protected override void Initialize()
        {
            canvas.Initialize(this);
            canvas.Scale = scale * Vector2.One;

            world = new World(new Vector2(0, GRAVITY));

            world.ContactManager.BeginContact += ContactStarted;
            world.ContactManager.EndContact   += ContactEnded;

            canvas.LoadContent(content);

            ribbon_segment = canvas.GetTexture("ribbon_segment");

            /*List<Vector2> path = new List<Vector2>();
             * path.Add(new Vector2(100, 100));
             * path.Add(new Vector2(500, 100));*/
            //ribbon = new RibbonObject(world, ribbon_segment, new Vector2(100,100), ribbon_segment.Width, path);
            seamstress = new SeamstressObject();

            seamstressController = new SeamstressForceController(seamstress);
            world.AddController(seamstressController);

            /*ribbonController = new RibbonForceController(ribbon);
             * world.AddController(ribbonController);*/

            objects = new List <Object>();
            //objects.Add(ribbon);
            objects.Add(seamstress);

            base.Initialize();
        }
コード例 #2
0
 /// <summary>
 /// Create a new controller for the given avatar
 /// </summary>
 /// <param name="s">The avatar</param>
 public SeamstressForceController(SeamstressObject s)
     : base(ControllerType.AbstractForceController)
 {
     seamstress = s;
 }
コード例 #3
0
 /// <summary>
 /// Create a new controller for the given avatar
 /// </summary>
 /// <param name="s">The avatar</param>
 public SeamstressForceController(SeamstressObject s)
     : base(ControllerType.AbstractForceController)
 {
     seamstress = s;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new input controller.
 /// </summary>
 public MainInputController(SeamstressObject seamstress, CoolRibbonObject ribbon)
 {
     this.seamstress = seamstress;
     this.ribbon     = ribbon;
 }
コード例 #5
0
        private bool sIsJumping; // seamstress is jumping?

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a new input controller.
        /// </summary>
        public MainInputController(SeamstressObject seamstress, CoolRibbonObject ribbon)
        {
            this.seamstress = seamstress;
            this.ribbon = ribbon;
        }
コード例 #6
0
ファイル: GameEngine.cs プロジェクト: kjin/ribbon_gameplay
        /// <summary>
        /// Perform any initialization necessary before running the game.  This
        /// includes both (preliminary) model and view creation.
        /// </summary>
        protected override void Initialize()
        {
            canvas.Initialize(this);
                canvas.Scale = scale * Vector2.One;

                world = new World(new Vector2(0,GRAVITY));

                world.ContactManager.BeginContact += ContactStarted;
                world.ContactManager.EndContact += ContactEnded;

                canvas.LoadContent(content);

                ribbon_segment = canvas.GetTexture("ribbon_segment");
                /*List<Vector2> path = new List<Vector2>();
                path.Add(new Vector2(100, 100));
                path.Add(new Vector2(500, 100));*/
                //ribbon = new RibbonObject(world, ribbon_segment, new Vector2(100,100), ribbon_segment.Width, path);
                seamstress = new SeamstressObject();

                seamstressController = new SeamstressForceController(seamstress);
                world.AddController(seamstressController);

                /*ribbonController = new RibbonForceController(ribbon);
                world.AddController(ribbonController);*/

                objects = new List<Object>();
                //objects.Add(ribbon);
                objects.Add(seamstress);

                base.Initialize();
        }