示例#1
0
        public override void Reload(object data)
        {
            world.Clear();

            // World limits (ground)
            float simulatedHeight = BoxicsGame.Viewport.Height / BoxicsGame.ViewScale;
            float simulatedWidth = BoxicsGame.Viewport.Width / BoxicsGame.ViewScale;

            BodyFactory.CreateEdge(world, new Vector2(0.0f, 0.0f), new Vector2(simulatedWidth, 0.0f));
            BodyFactory.CreateEdge(world, new Vector2(simulatedWidth, 0.0f), new Vector2(simulatedWidth, simulatedHeight));
            BodyFactory.CreateEdge(world, new Vector2(0.0f, simulatedHeight), new Vector2(simulatedWidth, simulatedHeight));
            BodyFactory.CreateEdge(world, new Vector2(0.0f, 0.0f), new Vector2(0.0f, simulatedHeight));

            // World objects/bodies and game rules
            level = GameLevelsFactory.CreateLevel(world, (int)data);
            rulesManager = new RulesManager(world, level);
        }
示例#2
0
 public RulesManager(World world, GameLevel level)
 {
     this.level = level;
     boxCreationManager = new BoxCreationManager(world, level.BoxAreas);
     IsLevelCompleted = false;
 }