Ejemplo n.º 1
0
        //Constructors
        public GameViewPanel(PlayScene parent)
        {
            Coordinate spawnPosition;

            spawnPosition.x         = 0;
            spawnPosition.y         = 0;
            parent.World.player     = new TankObject(spawnPosition, TankObject.TankColor.PLAYER);
            parent.World.allObjects = new List <GameObject>();
            this.camera             = Camera.Instance;
            this.parent             = parent;
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
 //Constructor
 public UnlimitedMapPanel(PlayScene parent) : base(parent)
 {
     background = new Sprite("SandBackground", "assets/images/sand-dune-seamless-texture.jpg", 0, 254, 0);
     leftToptexturePosition.x = 0;
     leftToptexturePosition.y = 0;
 }
Ejemplo n.º 4
0
 //Constructors
 public MapPanel(PlayScene parent)
 {
     this.parent = parent;
 }