public void ModuleInit() { gameInput = GameFramework.singleton.getInput(); gameRender = GameFramework.singleton.getGameRender(); InitGame(); }
public ArcadeProgram(IntCodeStateMachine cpu, IGameView gameView, IGameInput gameInput = null) { cpu.OnOutput += Advance; _gameView = gameView; gameInput.OnInput += (_, e) => cpu.SetInput(e); _gameState = new GameState(gameView, gameInput); }
public GameState(IGameView gameView, IGameInput gameInput) { currentGameState = CurrentState.Starting; _wallsCompletedAfterPaddle = 0; _gameView = gameView; _gameInput = gameInput; }
public void Initialize(Player player, IGameInput input, ProjectileBehaviour.Pool projectilePool) { _player = player; _input = input; _lastFireTime = -GameRules.FireCooldown; _projectilePool = projectilePool; }
public GameArea(ContentManager content, SpriteBatch spriteBatch, GraphicsDevice graphicsDevice, IGameInput gameInput) { _content = content; _spriteBatch = spriteBatch; _graphicsDevice = graphicsDevice; _gameInput = gameInput; _camera = new Camera2D(graphicsDevice); }
public DPad(IGameInput inputDevice, InputKey left, InputKey right, InputKey up, InputKey down) { this.InputDevice = inputDevice; this.Left = left; this.Right = right; this.Up = up; this.Down = down; }
public GamePlayer(IGameInput gameInput, IGameOutput gameOutput) { _gameGrid = new GameGrid(); _playerInput = new PlayerInput(gameInput, gameOutput); _gridMaker = new GridMaker(_playerInput, _gameGrid); _gameOutput = gameOutput; _nextGeneration = new NextGeneration(); }
public void SetUp() { stubPlayer = MockRepository.GenerateStub<IPlayer>(); stubGameInput = MockRepository.GenerateStub<IGameInput>(); stubCrosshair = MockRepository.GenerateStub<ICrosshair>(); stubRespawner = MockRepository.GenerateStub<IPlayerRespawner>(); kpc = new KeyboardPlayerController(stubPlayer, stubGameInput, stubCrosshair, stubRespawner); }
public Player(float x, float y, float height, float width, int texture) : base(x, y, height, width, texture) { this.input = new MouseAndKeyboard(); this.texRegion = new TexturedRegion(64 * 3, 256, 64, 64); setTexRegion(0, 0); lastVert = 0; lastTime = DateTime.Now.Ticks / (decimal)TimeSpan.TicksPerMillisecond; }
public void OnGlobalInput(IGameInput input) { if (input is StopDestroyingInput) { _enabled = false; } else if (input is StartDestroyingInput) { _enabled = true; } }
public void RemoveAxis(IGameInput axis) { if (axis == null || axesMapping.ContainsKey(axis) == false) { return; } axesMapping.Remove(axis); }
private void Start() { _input = inputObject.GetComponent <IGameInput>(); _tiles = new Tile[tilesCount, tilesCount]; InitializeVacantPositions(); GenerateTile(); GenerateTile(); }
public void RemoveAction(IGameInput action) { if (action == null || actionsMapping.ContainsKey(action) == false) { return; } actionsMapping.Remove(action); lastHandledActionValue.Remove(action); }
public void Init(IGameInput iInput, IGameCore iGameCore, IGameRender iGameRender) { theInput = iInput; theGameCore = iGameCore; theGameRender = iGameRender; theInput.ModuleInit(); theGameCore.ModuleInit(); theGameRender.ModuleInit(); }
public KeyboardPlayerController(IPlayer player, IGameInput gameInput, ICrosshair crosshair, IPlayerRespawner playerRespawner) { this.Player = player; this.GameInput = gameInput; this.Crosshair = crosshair; this.PlayerRespawner = playerRespawner; LastShootTime = float.MinValue; LastJumpTime = float.MinValue; }
void Start() { if (PlatformUtil.IsTouchDevice) { _gameInput = new SingleTouchGameInput(); } else { _gameInput = new WinGameInput(); } }
public override void OnInit() { if (IsTouchDevice) { _GameInput = new SingleTouchGameInput(); } else { _GameInput = new WinGameInput(); } }
public LiveEditor(QuickGameScene scene) { Scene = scene; KeyboardInput = Input.GetInput(scene); MouseInput = Input.GetMouseInput(scene); scene.AddObject(this); Cursor = new EditorCursor(scene); Menu = new EditorMenu(scene, this); ItemSelector = new ItemSelector(scene, this); }
public GameEngine(IBoard board, IMoveProcessor moveProcessor, IAIModule aiModule, IGameInput input, IGameOutput output) { _board = board; this.MoveProcessor = moveProcessor; this.MoveProcessor.Board = _board; this.AIModule = aiModule; this.Input = input; this.Output = output; this.Input.OnMoveReceived += Input_OnMoveReceived; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. #if USE_TOUCH _gameInput = new TouchScreenGameInput(Content, GraphicsDevice.Viewport); #else _gameInput = new KeyboardGameInput(); #endif _spriteBatch = new SpriteBatch(GraphicsDevice); _gameWorld = new GameWorld(this); _gameWorld.Setup(); }
void Start() { UICamera.genericEventHandler = this.gameObject; if (PlatformUtil.IsTouchDevice) { _gameInput = new SingleTouchGameInput(); } else { _gameInput = new WinGameInput(); } }
public Ufo(GameWorld gameWorld) : base(gameWorld, "ufo") { _gameInput = gameWorld.GameInput; _chainLinkTexture = gameWorld.Content.Load<Texture2D>("chain_link"); _chainBallTexture = gameWorld.Content.Load<Texture2D>("chain_ball"); var body = CreateUfoBody(); AddBallAndChain(body); Body = body; Body.OnCollision += OnCollision; }
public Dragon(GameWorld gameWorld) : base(gameWorld, "Dragon") { _gameInput = gameWorld.GameInput; _spriteEffect = SpriteEffects.None; _gameWorld = gameWorld; Body = BodyFactory.CreateRectangle(World, ConvertUnits.ToSimUnits(Width), ConvertUnits.ToSimUnits(Height), 1f, bodyType: BodyType.Dynamic); Body.FixedRotation = true; Body.OnCollision += OnCollision; }
public void AddAxis(IGameInput axis, string axisName) { if (axis == null) { throw new ArgumentNullException(nameof(axis)); } if (axisName == null) { throw new ArgumentNullException(nameof(axisName)); } axesMapping.Add(axis, axisName); }
/// <summary> /// Configures the game input based on Inspector choose. /// </summary> private void setControll() { switch (inputType) { case InputType.desktop: gameInput = new DesktopInput(); break; case InputType.joystick: gameInput = new JoystickInput(); break; } }
public Ufo(GameWorld gameWorld) : base(gameWorld, "ufo") { _gameInput = gameWorld.GameInput; _chainLinkTexture = gameWorld.Content.Load <Texture2D>("chain_link"); _chainBallTexture = gameWorld.Content.Load <Texture2D>("chain_ball"); var body = CreateUfoBody(); AddBallAndChain(body); Body = body; Body.OnCollision += OnCollision; }
public void AddAction(IGameInput action, string actionName) { if (action == null) { throw new ArgumentNullException(nameof(action)); } if (actionName == null) { throw new ArgumentNullException(nameof(actionName)); } actionsMapping.Add(action, actionName); lastHandledActionValue[action] = 0.0f; }
private void Start() { ServiceProvider.Instance.Game.SceneManager.SceneLoaded += SceneLoaded; defaultPitch = ServiceProvider.Instance.Game.Inputs.Pitch; myPitch = new GameInputMock { Id = defaultPitch.Id, DescriptiveName = defaultPitch.DescriptiveName }; defaultRoll = ServiceProvider.Instance.Game.Inputs.Roll; myRoll = new GameInputMock { Id = defaultRoll.Id, DescriptiveName = defaultRoll.Id }; }
public GameWorld(ChopperGame game) { _content = game.Content; _spriteBatch = game.SpriteBatch; _graphicsDevice = game.GraphicsDevice; _gameInput = game.GameInput; _camera = new Camera2D(_graphicsDevice); _world = new World(new Vector2(0, 10)); _timeStep = (float)game.TargetElapsedTime.TotalSeconds; _debugView = new DebugViewXNA(_world); _debugView.Flags = 0; _debugView.AppendFlags(DebugViewFlags.Shape); _debugView.AppendFlags(DebugViewFlags.Joint); _debugView.SleepingShapeColor = Color.YellowGreen; _crates = new List <Crate>(); }
public GameWorld(ChopperGame game) { _content = game.Content; _spriteBatch = game.SpriteBatch; _graphicsDevice = game.GraphicsDevice; _gameInput = game.GameInput; _camera = new Camera2D(_graphicsDevice); _world = new World(new Vector2(0, 10)); _timeStep = (float)game.TargetElapsedTime.TotalSeconds; _debugView = new DebugViewXNA(_world); _debugView.Flags = 0; _debugView.AppendFlags(DebugViewFlags.Shape); _debugView.AppendFlags(DebugViewFlags.Joint); _debugView.SleepingShapeColor = Color.YellowGreen; _crates = new List<Crate>(); }
public GameWorld(BubbleBobbleGame game) { _content = game.Content; _spriteBatch = game.SpriteBatch; _graphicsDevice = game.GraphicsDevice; _gameInput = game.GameInput; _camera = new Camera2D(_graphicsDevice); // Creates the farseer world with a gravity _world = new World(new Vector2(0, 20)); _timeStep = (float)game.TargetElapsedTime.TotalSeconds; // Setup the debug view _debugView = new DebugViewXNA(_world); _debugView.AppendFlags(DebugViewFlags.Shape); _debugView.AppendFlags(DebugViewFlags.PolygonPoints); _debugView.AppendFlags(DebugViewFlags.CenterOfMass); }
public GameController(IAsteroidsManager asteroidsManager, Player player, GameStateData gameStateData, IPlayerBehaviour playerBehaviour, ITimingManager timingManager, IGameInput gameInput, IOpponentBehaviour opponentBehaviour, IBoundProvider boundProvider) { _asteroidsManager = asteroidsManager; _player = player; _gameStateData = gameStateData; _playerBehaviour = playerBehaviour; _timingManager = timingManager; _gameInput = gameInput; _opponentBehaviour = opponentBehaviour; _boundProvider = boundProvider; _player.Death += OnDeath; _asteroidsManager.AsteroidDespawned += OnAsteroidDespawn; _gameInput.RestartPressed += OnRestartPressed; StartGame(); }
void Awake() { switch (_inputDevice) { case InputDevice.Mobile: _currentInputInstance = _gameInputMobile; break; case InputDevice.PC: _currentInputInstance = _gameInputPC; _movementJoystick.SetActive(false); _attackJoystick.SetActive(false); _nextWeaponButton.SetActive(false); _previousWeaponButton.SetActive(false); break; default: Debug.LogError("Selected input index out of range."); break; } }
public void OnInput(IGameInput input, IEntity entity) { Events.Add(TriggerEvent.OnInput); }
protected override void Establish_context() { base.Establish_context(); _cmd = MoveDirection.LEFT; _gameInput = new GameInput(); }
public void OnGlobalInput(IGameInput input) { ++CallCount; }
public MortalCoilSolver() : base() { this.gameSystem = system.SystemInterface; this.graphics = gameSystem.Graphics; this.input = gameSystem.Input; FPSComponent fps = new FPSComponent(this); this.r = new Random(); }
public void Initialize(IGameInput gameInput) { gameInput.PlayerMoveSignal += movement.Move; }
public override void SetUp(IGameState gameState) { cam = Camera.main; gameInput = BoltNetwork.Instantiate(BoltPrefabs.Game_Input) .GetState <IGameInput>(); }
public void OnGlobalInput(IGameInput input) { Events.Add(TriggerEvent.OnGlobalInput); }
public ChopperGame() { _graphics = new GraphicsDeviceManager(this); _gameInput = new KeyboardGameInput(); Content.RootDirectory = "Content"; }