Example #1
0
        public override void Initialize()
        {
            world = new World(new Vector2(0, WorldConstants.GRAVITY));
            player = new Player(world, new Vector2(5, 5));
            forceController = new ForceController(InputController, player);
            //ribbon = RibbonFactory.Get(world, ribbonStorage);

            transform = new GameplayTransform(new Vector2(5, 5), 1f);

            ground = new List<Ground>();
            List<Vector2> rectangle = new List<Vector2>();
            rectangle.Add(new Vector2(-3,0));
            rectangle.Add(new Vector2(15,0));
            rectangle.Add(new Vector2(15,2));
            rectangle.Add(new Vector2(-3,2));
            PolygonF polygon;
            polygon.points = rectangle;
            ground.Add(new Ground(world, polygon, GroundType.Ground));

            RibbonStorage ribbonStorage = new RibbonStorage();
            List<Vector2> path = new List<Vector2>();
            path.Add(new Vector2(-5, 3));
            path.Add(new Vector2(17, 3));
            ribbonStorage.Path = path;
            ribbonStorage.Start = 5;
            ribbonStorage.End = 10;

            ribbon = RibbonFactory.Get(world, ribbonStorage);
        }
Example #2
0
 protected override bool IntegrateChild(AssetManager assets, LayoutTreeNode childNode)
 {
     switch (childNode.Key)
     {
         case "Ribbons":
             RibbonStorage ribbon = new RibbonStorage();
             ribbon.Integrate(null, childNode);
             ribbons.Add(ribbon);
             return true;
         case "World":
             worldNumber = Convert.ToInt32(childNode.Value);
             return true;
         case "Level":
             levelNumber = Convert.ToInt32(childNode.Value);
             return true;
     }
     return false;
 }
Example #3
0
 public static Ribbon Get(World world, RibbonStorage ribbonStorage)
 {
     return new UnloopedRibbon(world, ribbonStorage.Path, ribbonStorage.Start, ribbonStorage.End);
 }