Exemple #1
0
        public StandardMelee(InputHandler handler)
        {
            _mousePosition = new Vector2f(500, 500);

            CurrentStatus = StatusState.WaitingForPlayers;

            uiState = UIStateTypes.Normal;
            currentHotkey = null;
            currentHotkeySheet = null;
            standardHotkeys = Settings.GetSheet("standard_game_mode_controls");

            InputHandler = handler;
            myId = 0;
            map = new TileMap();

            allowMinimapCameraMove = true;
            selectedUnits = null;
            controlGroups = new Dictionary<Keyboard.Key, List<EntityBase>>();

            for (int i = 27; i <= 35; i++)
            {
                controlGroups.Add((Keyboard.Key) i, new List<EntityBase>());
            }

            controlBoxP1 = new Vector2f(0, 0);
            controlBoxP2 = new Vector2f(0, 0);
            selectedAttackMove = false;
            releaseSelect = false;

            CameraPosition = new Vector2f(0, 0);

            miniMap = new MiniMap(map, Fog, entities);

            //Load Sprites
            bottomHUDGUI = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/BottomGUI.png"));
            alertHUDAlert = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_Alert.png"));
            alertHUDUnitCreated = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_UnitCreated.png"));
            alertHUDBuildingCreated =
                new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_BuildingFinished.png"));

            avatarWorker = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_AVATAR_WORKER.png"));

            hudBoxUnit = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Unit.png"));
            hudBoxBuilding = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Building.png"));

            hudControlBox = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/ControlGroupBox.png"));
            hudControlBox.Origin = new Vector2f(hudControlBox.TextureRect.Width/2, 0);

            viewBounds = new Sprite(ExternalResources.GTexture("Resources/Sprites/Hud/ViewBounds.png"));

            //Load Sounds
            moveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/MoveCommand/0.wav"));
            attackMoveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/AttackCommand/0.wav"));

            backgroundMusic = new Music("Resources/Audio/Music/In Game/mario.wav");
            backgroundMusic.Loop = true;
            backgroundMusic.Volume = Settings.MUSICVOLUME;
            backgroundMusic.Play();
        }
Exemple #2
0
        public MiniMap(Level.TileMap tileMap, FogOfWar fog, Dictionary<ushort, Entities.EntityBase> entities )
        {
            Team = 0;
            Entities = entities;
            TileMap = tileMap;
            Fog = fog;

            CameraPosition = new Vector2f(0, 0);
            renderTexture = new RenderTexture(SIZEX, SIZEY);

            MapSprite = new Sprite(renderTexture.Texture);
        }
Exemple #3
0
        public GameModeBase()
        {
            myId = 0;
            idSet = false;

            map = new TileMap();

            alerts = new List<HUDAlert>();
            entities = new Dictionary<ushort, EntityBase>();
            players = new Dictionary<byte, Player>();

            Effects = new List<EffectBase>();

            pathFinding = null;

            Fog = null;

            deathSound_Cliff = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/Death/0.wav"));
            unitCompleteSound_Worker = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/UnitCompleted/0.wav"));
            useSound_Cliff = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/UseCommand/0.wav"));
            gatherResourceSound_Cliff = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/GetResources/0.wav"));
            attackSound_Cliff = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/OnAttack/0.wav"));
        }