Exemplo n.º 1
0
        public World(ContentManager Content, Game1 game, Player player, string filename)
        {
            this.game    = game;
            this.Content = Content;
            this.scripts = new Queue <ScriptChain>();
            this.ui      = new UiSystem(Content);

            lua = new Lua();
            lua.LoadCLRPackage();

            this.player = player;
            this.player.setWorld(this);

            lua["l"]      = new LuaAPI(game, this, ui, this.player, Content);
            lua["player"] = this.player;
            lua.DoString(@"
                import ('Lakeside2', 'Lakeside2')
                import ('Lakeside2', 'Lakeside2.UI')
                import ('Lakeside2', 'Lakeside2.Scripting')");

            camera = new TilemapCamera(null);
            TileMap map;

            if (filename == null)
            {
                map = new TileMap(Content, 20, 10);
            }
            else
            {
                map = SerializableMap.Load(Content, filename);
            }
            setMap(map);
            camera.setCenteringEntity(this.player);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Draw this entity in world-space using a <see cref="TilemapCamera"/>
 /// </summary>
 /// <param name="wrapper"></param>
 /// <param name="camera"></param>
 public void draw(SBWrapper wrapper, TilemapCamera camera)
 {
     draw(wrapper, camera.worldToScreen(location));
 }