Exemple #1
0
        /// <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();
        }
Exemple #2
0
        /// <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();
        }