protected override void Update() { if (RawKeyboardInput.IsPressed(Keys.Space)) { playRandomSong(); } else if (RawKeyboardInput.IsPressed(Keys.R)) { restartSong(); } else if (RawKeyboardInput.IsPressed(Keys.Up)) { playPreviousAlbum(); } else if (RawKeyboardInput.IsPressed(Keys.Down)) { playNextAlbum(); } else if (RawKeyboardInput.IsPressed(Keys.Left)) { playPreviousSong(); } else if (RawKeyboardInput.IsPressed(Keys.Right)) { playNextSong(); } }
protected override void Update() { if (RawKeyboardInput.IsPressed(LeftBumpKey)) { current -= RawKeyboardInput.IsHeld(Keys.LeftShift, Keys.RightShift) ? bumpPercentage * .5f : bumpPercentage; OnAdjustControl(MathHelper.Lerp(Min, Max, current)); } else if (RawKeyboardInput.IsPressed(RightBumpKey)) { current += RawKeyboardInput.IsHeld(Keys.LeftShift, Keys.RightShift) ? bumpPercentage * .5f : bumpPercentage; OnAdjustControl(MathHelper.Lerp(Min, Max, current)); } }
protected override void Update() { for (int v = 0; v < 8; v++) { if (RawKeyboardInput.IsPressed(numRowKeys[v], numPadKeys[v])) { bool isMuted = enabledVoices[v].DrawEnabled; Music.SetVoiceMute(v, isMuted); enabledVoices[v].DrawEnabled = !isMuted; } } }
public override void Update() { base.Update(); if (RawKeyboardInput.IsPressed(Keys.OemTilde)) { IsDisplaying = !IsDisplaying; } if (!IsDisplaying) { return; } handleKeyboardInput(); }
private void updateBumpControl() { if (RawKeyboardInput.IsPressed(Keys.Left, Keys.A)) { Object.LocalPosition = Object.LocalPosition.PlusX(-1); } else if (RawKeyboardInput.IsPressed(Keys.Right, Keys.D)) { Object.LocalPosition = Object.LocalPosition.PlusX(1); } if (RawKeyboardInput.IsPressed(Keys.Up, Keys.W)) { Object.LocalPosition = Object.LocalPosition.PlusY(-1); } else if (RawKeyboardInput.IsPressed(Keys.Down, Keys.S)) { Object.LocalPosition = Object.LocalPosition.PlusY(1); } }
protected override void Update() { AxisDirections?moveDirection = null; if (RawKeyboardInput.IsPressed(Keys.W) || RawGamepadInput.IsDpadPressed(AxisDirections.Up) || RawGamepadInput.IsLeftJoystickPressed(AxisDirections.Up)) { moveDirection = AxisDirections.Up; } else if (RawKeyboardInput.IsPressed(Keys.D) || RawGamepadInput.IsDpadPressed(AxisDirections.Right) || RawGamepadInput.IsLeftJoystickPressed(AxisDirections.Right)) { moveDirection = AxisDirections.Right; } else if (RawKeyboardInput.IsPressed(Keys.S) || RawGamepadInput.IsDpadPressed(AxisDirections.Down) || RawGamepadInput.IsLeftJoystickPressed(AxisDirections.Down)) { moveDirection = AxisDirections.Down; } else if (RawKeyboardInput.IsPressed(Keys.A) || RawGamepadInput.IsDpadPressed(AxisDirections.Left) || RawGamepadInput.IsLeftJoystickPressed(AxisDirections.Left)) { moveDirection = AxisDirections.Left; } if (moveDirection != null) { Point destination = coords + ((AxisDirections)moveDirection).ToPoint(); if (checkCanMove(destination)) { GameGrid[coords.X, coords.Y] = null; GameGrid[destination.X, destination.Y] = Object; coords = destination; } } Diagonals?diagonalDir = null; if (RawKeyboardInput.IsPressed(Keys.Q)) { diagonalDir = Diagonals.UpLeft; } else if (RawKeyboardInput.IsPressed(Keys.E)) { diagonalDir = Diagonals.UpRight; } else if (RawKeyboardInput.IsPressed(Keys.Z)) { diagonalDir = Diagonals.DownLeft; } else if (RawKeyboardInput.IsPressed(Keys.C)) { diagonalDir = Diagonals.DownRight; } if (diagonalDir != null) { Sfx.PlaySfx("sfx1"); GameObject projectileObj = ProjectileController.BuildObject(PROJ_SPEED, PROJ_SIZE, PROJ_BOUNCES, ((Diagonals)diagonalDir).ToVector2()); projectileObj.LocalPosition = Object.LocalPosition.Plus(tileSize / 2 - 1); Pigeon.World.AddObj(projectileObj); } }