Пример #1
0
        protected override void LoadContent()
        {
            _map = Content.Load<Map>(@"Maps\Plains\3");
            G.World.Camera.BoundsEnabled = true;
            G.World.Camera.BoundedArea = new Rectangle(0, 0, _map.Width * _map.TileWidth, _map.Height * _map.TileHeight);
            G.Collision.DefineWorld(_map.Width * _map.TileWidth, _map.Height * _map.TileHeight, 32);

            G.World.Add(_map);
            G.World.Camera.Follow(_player = TransformableEntity.Get("Lily") as TransformableEntity);
            G.EditorForm.grdProperty.SelectedObject = Entity.Get("flowermagic") as SpriteEmitter;

            Label lblControls = new Label();
            lblControls.Text.Append(CONTROLS);
            lblControls.Position = new Vector2(G.ScreenCenter.X, 0);
            lblControls.BackColor = Color.Gray;
            lblControls.ForeColor = Color.White;
            G.UI.HUD.Add(lblControls);

            base.LoadContent();
        }
Пример #2
0
        protected override void LoadContent()
        {
            _map = Content.Load<Map>(@"Maps\Plains\4");
            G.World.Camera.BoundsEnabled = true;
            G.World.Camera.BoundedArea = new Rectangle(0, 0, _map.Width * _map.TileWidth, _map.Height * _map.TileHeight);
            G.Collision.DefineWorld(_map.Width * _map.TileWidth, _map.Height * _map.TileHeight, 32);

            G.World.Add(_map);
            G.World.Camera.Follow(_player = TransformableEntity.Get("Lily") as TransformableEntity);

            //add objects to editor form
            List<object> objs = Entity.GlobalEntities.Cast<object>().ToList<object>();
            G.EditorForm.AddObjects(objs);

            Label lblControls = new Label();
            lblControls.Text.Append(CONTROLS);
            lblControls.Position = new Vector2(G.ScreenCenter.X, 0);
            lblControls.BackColor = Color.Gray;
            lblControls.ForeColor = Color.White;
            G.UI.HUD.Add(lblControls);

            base.LoadContent();
        }