コード例 #1
0
        public ParticleEngine(A3RData a3RData)
        {
            _a3RData = a3RData;

            _particles         = new List <Particle>(500);
            _particlesToRemove = new List <Particle>();
            _particlesToAdd    = new List <Particle>();
            _random            = new Random();
        }
コード例 #2
0
        public UI_Minimap(A3RData a3Rdata, Camera camera)
            : base(camera)
        {
            _a3RData = a3Rdata;
            _width   = 300;
            _height  = 20;

            Pos = new Vector(1250, 80);
        }
コード例 #3
0
        public UI_PlayerSelectTemplate(A3RData a3RData, endSelectStage endSelectStage) : base(a3RData)
        {
            _endSelectStage = endSelectStage;


            _menuLogo = new UI_StaticImage(Camera, Width(0.45f), Height(0.14f),
                                           SwinGame.BitmapNamed("menuLogo"));
            AddElement(_menuLogo);
        }
コード例 #4
0
        public UI_PlayerSelectNumberPlayers(A3RData a3RData, endSelectStage endSelectStage)
            : base(a3RData, endSelectStage)
        {
            _background = new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("shopBg"));
            AddElement(_background);

            AddElement(new UI_Text(Camera, Width(0.5f), Height(0.35f),
                                   Color.Black, "Number of players:", true));
            A3RData.NumberOfPlayers = 0;
        }
コード例 #5
0
ファイル: UI_TextBox.cs プロジェクト: Mikanwolfe/Artillery3
        public UI_TextBox(A3RData a3RData, int width, int height, Vector pos)
            : base(a3RData, width, height, pos)
        {
            _textStrings = new List <string>();
            _padding     = 10;

            _specialCharacters = new Dictionary <string, SpecialCharacter>();

            _specialCharacters.Add("---", HorizontalRule);
        }
コード例 #6
0
        public UI_Box(A3RData a3RData, int width, int height, Vector pos)
            : base(a3RData)
        {
            _width     = width;
            _height    = height;
            Pos        = pos;
            _color     = SwinGame.RGBAFloatColor(0.3f, 0.3f, 0.3f, 0.5f);
            _textColor = Color.White;

            _colorAlpha = 0;
        }
コード例 #7
0
        public PhysicsEngine(A3RData a3RData)
        {
            _a3RData            = a3RData;
            _windowRect         = _a3RData.WindowRect;
            _components         = new List <IPhysicsComponent>();
            _componentsToRemove = new List <IPhysicsComponent>();

            _boundaryBox = new Rectangle()
            {
                X      = -Constants.BoundaryBoxPadding,
                Y      = -Constants.BoundaryBoxPadding,
                Width  = _a3RData.WindowRect.Width + Constants.BoundaryBoxPadding * 2,
                Height = _a3RData.WindowRect.Height + Constants.BoundaryBoxPadding * 2
            };
        }
コード例 #8
0
ファイル: UI_MainMenu.cs プロジェクト: Mikanwolfe/Artillery3
        public UI_MainMenu(A3RData a3RData) : base(a3RData)
        {
            AddElement(new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("shopBg")));
            Rectangle _windowRect = A3RData.WindowRect;

            AddElement(new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("fullBg")));

            UI_DynamicImage _menuGradient = new UI_DynamicImage(A3RData.Camera, -20, 0, -5000, 0, 10, SwinGame.BitmapNamed("menuLeftWhite"));

            AddElement(_menuGradient);

            _menuGradient = new UI_DynamicImage(A3RData.Camera, 0, 0, -5000, 0, 10, SwinGame.BitmapNamed("menuGradientFull"));
            AddElement(_menuGradient);

            _menuGradient = new UI_DynamicImage(A3RData.Camera, 0, 0, -8000, 0, 15, SwinGame.BitmapNamed("menuGradientHalf"));
            AddElement(_menuGradient);

            UI_StaticImage _menuLogo = new UI_StaticImage(a3RData.Camera, _windowRect.Width * 0.022f, _windowRect.Height * 0.24f, SwinGame.BitmapNamed("menuLogo"));

            AddElement(_menuLogo);

            _playButton = new UI_Button(a3RData.Camera, "New Game", _windowRect.Width * 0.026f, _windowRect.Height * 0.417f, UIEvent.StartGame,
                                        SwinGame.BitmapNamed("startButton"), SwinGame.BitmapNamed("startButtonSelected"));
            _playButton.OnUIEvent           += UserInterface.Instance.NotifyUIEvent;
            _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound");
            AddElement(_playButton);

            _playButton = new UI_Button(a3RData.Camera, "Load Game", _windowRect.Width * 0.026f, _windowRect.Height * 0.466f, UIEvent.StartGame,
                                        SwinGame.BitmapNamed("loadButton"), SwinGame.BitmapNamed("loadButtonSelected"));
            _playButton.OnUIEvent           += UserInterface.Instance.NotifyUIEvent;
            _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound");
            AddElement(_playButton);

            _playButton = new UI_Button(a3RData.Camera, "Test Text", _windowRect.Width * 0.026f, _windowRect.Height * 0.520f, UIEvent.StartGame,
                                        SwinGame.BitmapNamed("optionsButton"), SwinGame.BitmapNamed("optionsButtonSelected"));
            _playButton.OnUIEvent           += UserInterface.Instance.NotifyUIEvent;
            _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound");
            AddElement(_playButton);

            _playButton = new UI_Button(a3RData.Camera, "Exit", _windowRect.Width * 0.026f, _windowRect.Height * 0.572f, UIEvent.Exit,
                                        SwinGame.BitmapNamed("exitButton"), SwinGame.BitmapNamed("exitButtonSelected"));
            _playButton.OnUIEvent           += UserInterface.Instance.NotifyUIEvent;
            _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound");
            AddElement(_playButton);
        }
コード例 #9
0
        public UI_ShopMenu(A3RData a3RData, NotifyPlayerFinishedShop notifyPlayerFinishedShop)
            : base(a3RData)
        {
            _notifyPlayerFinishedShop = notifyPlayerFinishedShop;

            _shopBackground = SwinGame.BitmapNamed("shopBg");

            AddElement(new UI_StaticImage(a3RData.Camera, Width(0.5f), Height(0.24f), SwinGame.BitmapNamed("menuLogo")));

            _characterBox = new UI_Box(A3RData, 300, 200, new Vector(20, 20));
            _statBox      = new UI_TextBox(A3RData, 300, 370, new Vector(20, 240));
            _equipBox     = new UI_EquipBox(A3RData, 300, 750, new Vector(Width(1) - 320, 20), RefreshShopItems);

            UI_Button _nextButton = new UI_Button(Camera, "Next", Width(1) - 170, Height(1) - 60, FinishShopButton);

            _nextButton.Width = 300;
            _nextButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound");
            _nextButton.MiddleAligned        = true;
            _nextButton.LockToScreen();

            _fadeFx = new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("fadeFx"));

            if (A3RData.EasterEggTriggered)
            {
                AddElement(new UI_StaticImage(a3RData.Camera, Width(0.5f), Height(-1f), SwinGame.BitmapNamed("ddlc")));
            }

            _playerName    = A3RData.SelectedPlayer.Name;
            _characterName = A3RData.SelectedPlayer.Character.Name;
            _shopItems     = new UI_ShopItems(A3RData, RefreshEquipBox);
            AddElement(_shopItems);

            AddElement(_nextButton);
            AddElement(_equipBox);
            AddElement(_characterBox);
            AddElement(_statBox);

            AddElement(new UI_HealthUpgradeButton(a3RData, 300, 60, new Vector(20, _statBox.Pos.Y + 390)));
            AddElement(new UI_ArmourUpgradeButton(a3RData, 300, 60, new Vector(20, _statBox.Pos.Y + 390 + 80)));

            AddElement(_fadeFx);

            _selPlayer = A3RData.SelectedPlayer;
        }
コード例 #10
0
        public UI_PlayerSelectNames(A3RData a3RData, endSelectStage endSelectStage)
            : base(a3RData, endSelectStage)
        {
            _background = new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("shopBg"));
            AddElement(_background);


            _playerText = new UI_Text(Camera, Width(0.5f), Height(0.35f),
                                      Color.Black, "Player X:", true);
            AddElement(_playerText);

            _isComputerPlayer = new UI_CheckBox(Camera,
                                                new Vector(Width(0.59f), Height(0.397f)), "Computer Player?");

            AddElement(_isComputerPlayer);
            _inputMethodKey = new Dictionary <bool, IInputMethod>();
            _inputMethodKey.Add(true, new AIInputMethod());
            _inputMethodKey.Add(false, new PlayerInputMethod());
        }
コード例 #11
0
ファイル: Artillery3R.cs プロジェクト: Mikanwolfe/Artillery3
        public Artillery3R()
        {
            LoadResources();
            _a3RData = new A3RData();
            Services.Initialise(_a3RData);
            _windowRect = _a3RData.WindowRect;
            UserInterface.Instance.UIEventOccurred = UIEventOccured;

            _gameState = new Stack <GameState>();

            _gameStateTransitions = new Dictionary <UIEvent, GameState>();
            _gameStateTransitions.Add(UIEvent.StartGame, new PlayerSelectGameState(_a3RData));
            _gameStateTransitions.Add(UIEvent.MainMenu, new MainMenuGameState(_a3RData));
            _gameStateTransitions.Add(UIEvent.StartCombat, new CombatGameState(_a3RData));
            _gameStateTransitions.Add(UIEvent.EndCombat, new ShopGameState(_a3RData));
            _gameStateTransitions.Add(UIEvent.Exit, new ExitState(_a3RData));

            //TODO: Add in the rest of the UI transitions here
        }
コード例 #12
0
 public void HandleInput(A3RData a3RData) //yes that means we can only handle one command at a time.
 {
     foreach (KeyCode k in _registeredKeys)
     {
         if (SwinGame.KeyDown(k))
         {
             if (a3RData.SelectedPlayer != null)
             {
                 //_keyToCommands[k].Execute(a3RData);
                 a3RData.CommandStream.AddCommand(_keyToCommands[k]);
             }
             else
             {
                 throw new MissingMemberException("selectedPlayer not found", "a3Data.SelectedPlayer");
             }
             //We can fix this later
         }
     }
 }
コード例 #13
0
        public UI_SelectableTextBox(A3RData a3RData, int width, int height, Vector pos)
            : base(a3RData, width, height, pos)
        {
            _activeMouseArea = new Rectangle()
            {
                X      = Pos.X,
                Y      = Pos.Y,
                Width  = width,
                Height = height
            };

            _rectangleArea = new Rectangle()
            {
                X      = Pos.X + Camera.Pos.X,
                Y      = Pos.Y + Camera.Pos.Y,
                Width  = width,
                Height = height
            };
        }
コード例 #14
0
        public UI_PlayerSelect_Legacy(A3RData a3RData)
            : base(a3RData)
        {
            _stateComponent = new StateComponent <PlayerSelectState>(PlayerSelectState.ReadingNumberPlayers);

            _menuLogo = new UI_StaticImage(a3RData.Camera, Width(0.45f), Height(0.14f), SwinGame.BitmapNamed("menuLogo"));
            AddElement(_menuLogo);

            textElement = new UI_Text(a3RData.Camera, Width(0.5f), Height(0.35f),
                                      Color.Black, "Number of players:", true);
            AddElement(textElement);



            //start reading number players.
            SwinGame.StartReadingText(Color.Black, 20, SwinGame.FontNamed("guiFont"),
                                      (int)Width(0.5f), (int)Height(0.4f));

            _players = Artillery3R.Services.A3RData.Players;
        }
コード例 #15
0
        public UI_Combat(A3RData a3RData)
            : base(a3RData)
        {
            _a3RData = a3RData;

            _playerChargeBar = new UI_LoadingBar(_a3RData.Camera, 400, 30, Color.Orange,
                                                 (int)(_a3RData.WindowRect.Width * 0.7),
                                                 (int)(_a3RData.WindowRect.Height * 0.88));

            _playerFuel = new UI_LoadingBar(_a3RData.Camera, 400, 20, Color.SteelBlue,
                                            (int)(_a3RData.WindowRect.Width * 0.7),
                                            (int)(_a3RData.WindowRect.Height * 0.92));


            AddElement(_playerChargeBar);
            AddElement(_playerFuel);

            AddElement(new UI_Minimap(a3RData, Camera));

            AddElement(new UI_WindMarker(_a3RData.Camera, _a3RData.Wind));
        }
コード例 #16
0
        public CombatGameState(A3RData a3RData)
            : base(a3RData)
        {
            _a3RData    = a3RData;
            _windowRect = a3RData.WindowRect;

            _cameraFocusPoint = new CameraFocusPoint();

            A3RData.Environment = new Environment(_windowRect, A3RData.Camera);

            _state = new StateComponent <CombatState>(CombatState.TrackingPlayer); //change to loading later

            A3RData.Satellite = new Satellite("Maia", Constants.TerrainWidth / 2, -300);

            _inputHandler = new InputHandler();

            _observer = new CombatStateObserver(this);

            UIModule = new UI_Combat(A3RData);

            _backgroundBg = SwinGame.BitmapNamed("combatBg");

            _turnCount = 0;
        }
コード例 #17
0
 public UI_ArmourUpgradeButton(A3RData a3RData, int width, int height, Vector pos)
     : base(a3RData, width, height, pos)
 {
     _camera = A3RData.Camera;
 }
コード例 #18
0
 public MainMenuGameState(A3RData a3RData) : base(a3RData)
 {
     UIModule = new UI_MainMenu(A3RData);
 }
コード例 #19
0
 public LoadingGameState(Stack <GameState> gameStates, A3RData a3RData) : base(null)
 {
     _gameStates = gameStates;
     _a3RData    = a3RData;
 }
コード例 #20
0
 public ShopGameState(A3RData a3RData)
     : base(a3RData)
 {
 }
コード例 #21
0
 public override void Execute(A3RData a3RData)
 {
     a3RData.SelectedPlayer.Character.FireWeapon();
 }
コード例 #22
0
 public UI_WinScreen(A3RData a3RData)
     : base(a3RData)
 {
 }
コード例 #23
0
 public ServicesModule(A3RData a3RData)
 {
     _a3RData = a3RData;
 }
コード例 #24
0
ファイル: UI_EquipBox.cs プロジェクト: Mikanwolfe/Artillery3
 public UI_EquipBox(A3RData a3RData, int width, int height, Vector pos, PlayerSellEvent onPlayerSell)
     : base(a3RData, width, height, pos)
 {
     _onPlayerSell = onPlayerSell;
     RefreshUIBox();
 }
コード例 #25
0
 public GameState(A3RData a3RData)
 {
     Enabled  = true;
     _a3RData = a3RData;
 }
コード例 #26
0
 public void Initialise(A3RData a3RData)
 {
     _a3RData = a3RData;
     _uiElements.Clear();
 }
コード例 #27
0
 public override void Execute(A3RData a3RData)
 {
     a3RData.SelectedPlayer.Money += _amount;
 }
コード例 #28
0
 public ExitState(A3RData a3RData) : base(a3RData)
 {
     UIModule = new UIElementAssembly(A3RData);
 }
コード例 #29
0
 public override void Execute(A3RData a3RData)
 {
     a3RData.SelectedPlayer.Character.MoveRight();
 }
コード例 #30
0
 public PlayerSelectGameState(A3RData a3RData)
     : base(a3RData)
 {
     UIModule = new UI_PlayerSelectNumberPlayers(A3RData, PlayerSelectHandler);
 }