Beispiel #1
0
        public FarmUI(GameLoop ctx)
        {
            FarmOptionsUI = new FarmOptionsUI(this);
            Farm          = new Farm();


            Farm.Buildings.Build <Henhouse>(600, 740);
            Farm.Buildings.Build <EggStorage>(800, 740);


            CtxGame = ctx;
            BuildingCollectionUI = new BuildingCollectionUI(this);
            PlayerUI             = new PlayerUI(this, Farm.Player);

            Font font = new Font(FontLocation);

            Text = new Text("", font);



            //ButtonSellEggs = new RectangleShape( _buttonSize ) { Position = _buttonPos };
        }
Beispiel #2
0
        public TileMap(string file, GameLoop gameCtx)
        {
            GameCtx  = gameCtx;
            _map     = new TmxMap(file);
            UnderMap = new VertexArray[UnderLayer];
            OverMap  = new VertexArray[_map.Layers.Count - UnderLayer];

            MapSize  = _map.Height;
            TileSize = _map.TileHeight;
            Console.WriteLine(file);
            LoadTexture();
            int?imageWidth = _map.Tilesets[0].Image.Width;  //check for null expression

            if (imageWidth != null)
            {
                TileSetSize = ( int )imageWidth;
            }

            Collide = new VertexArray(PrimitiveType.Quads, 4 * (uint)(_map.Width * _map.Height));

            ConvertLayers();
            Season = 0;
        }
Beispiel #3
0
        private static void Main()
        {
            GameLoop game = new GameLoop();

            game.Run();
        }
Beispiel #4
0
 public InputHandler(GameLoop ctxGameLoop)
 {
     CtxGameLoop = ctxGameLoop;
 }