Exemple #1
0
        public void RaiseEvents(GameTime gameTime, GameObjectList gameObjects)
        {
            foreach (var gameObject in gameObjects)
            {
                var inputState = gameObject.Components.Get <CInputState>();

                foreach (var action in _allInputActions)
                {
                    if (inputState.ActionPressed(action))
                    {
                        _signal.Notify($"InputActionPressed:{Enum.GetName(typeof(InputActions), action)}",
                                       new GameObjectEventArgs(this, gameObject));
                    }

                    if (inputState.ActionReleased(action))
                    {
                        _signal.Notify($"InputActionReleased:{Enum.GetName(typeof(InputActions), action)}",
                                       new GameObjectEventArgs(this, gameObject));
                    }
                }
            }
        }
Exemple #2
0
        public void Start(IEnumerable <object> bindings)
        {
            _overworld.LoadMaps("maps/");
            _overworld.SetMap("novalondinium");

            Player.PlayerData.Position.Position = new Vector2(8400, 6000);

            Stage.ChangeScene <Test>();
            //_sceneMachine.Push(new WorldScene(_assetLoader, _renderer, _overworld, _spriteBatch, _gameState, _signal,
            //    _graphicsDevice, _canvasSize));
            //_sceneMachine.Push(new TitleScene(_services));
            //_sceneMachine.Push(new WorldLogicScene(_gameState, _assetLoader, _spriteBatch, _overworld, _signal));

            _signal.Notify("GameStart", new GameEventArgs(this));

            //_audio.PlayBgm("key");
        }
Exemple #3
0
 public void Notify(string signal)
 {
     _signal.Notify(signal, null);
 }