예제 #1
0
        public GameController(Game engine, GameMap map)
        {
            this.game   = engine;
            this.map    = map;
            this.sounds = new GameSounds();

            // * Indlæs animationer for diverse enheder
            RifleInfantry.InitializeGraphics();
            Barracks.InitializeGraphics();
            Refinery.InitializeGraphics();
            Jeep.InitializeGraphics();

            game.AddEntity(new MapBackground(map.GetSize(), map.GetTileSize()));
        }
예제 #2
0
        public void StartPlacing(string structureName)
        {
            // * Todo: skal kun kunne vælges hvis man har nok penge, mv.
            Structure newStructure = null;

            switch (structureName)
            {
            case "Barracks":
                newStructure         = new Barracks();
                newStructure.Opacity = 128;                         // * gør den alphatransperant, da den ikke er placeret endnu
                placingStructure     = newStructure;
                PlaceEntity(placingStructure);
                break;

            case "Refinery":
                newStructure         = new Refinery();
                newStructure.Opacity = 128;                         // * gør den alphatransperant, da den ikke er placeret endnu
                placingStructure     = newStructure;
                PlaceEntity(placingStructure);
                break;
            }
        }