Exemple #1
0
        //Accessors

        //Methods
        public override void Enter()
        {
            PlayParameters playParameters = new PlayParameters();

            List <MenuItem> menuItems = new List <MenuItem>();

            playParameters.mapType = MapTypeEnum.UNLIMITED;
            menuItems.Add(new MenuItem(new StartGameCommand(playParameters), "StartUnlimited", "Start Unlimited"));
            playParameters.mapType     = MapTypeEnum.TILED;
            playParameters.mapFileName = "test2.json";
            menuItems.Add(new MenuItem(new StartGameCommand(playParameters), "StartTiled", "Start Tiled"));
            menuItems.Add(new MenuItem(new QuitGameCommand(), "Quit", "Quit"));

            menuPanel = new MenuPanel(menuItems);

            menuPanel.SetPosition((WindowX * 1 / 3), 100);
        }
Exemple #2
0
        //Constructor
        public TiledMapPanel(PlayScene parent, PlayParameters parameters) : base(parent)
        {
            tileTextures     = new Dictionary <string, Sprite>();
            tileSetsMetaData = new Dictionary <string, TileSetMetaData>();
            mapMetaData      = Maploader.Instance.LoadMapMetaData(parameters.mapFileName);
            foreach (TileSets entry in mapMetaData.tilesets)
            {
                TileSetMetaData metaData = Maploader.Instance.LoadTileSetMetaData(entry.source);

                tileTextures.Add(entry.source, new Sprite(metaData.name, "assets/images/" + metaData.image, 0, 254, 0));
                tileTextures[entry.source].SubRect.h = mapMetaData.tileheight;
                tileTextures[entry.source].SubRect.w = mapMetaData.tilewidth;
                tileTextures[entry.source].Pos.h     = mapMetaData.tileheight;
                tileTextures[entry.source].Pos.w     = mapMetaData.tilewidth;

                tileSetsMetaData.Add(entry.source, metaData);
            }
        }
Exemple #3
0
 //Constructors
 public PlayScene(PlayParameters parameters)
 {
     playParameters = parameters;
 }