public void Input_NormalMovement() { #region Left&Right if (InputMgr.IsPressing("Left")) { currentHorizontalSpeed = -currentSpeed * 2f; } else if (InputMgr.IsPressing("Right")) { currentHorizontalSpeed = currentSpeed * 2f; } else { currentHorizontalSpeed = 0; } #endregion #region Down&UP if (InputMgr.IsPressing("Up")) { currentVerticalSpeed = -currentSpeed; } else if (InputMgr.IsPressing("Down")) { currentVerticalSpeed = currentSpeed; } else { currentVerticalSpeed = 0; } #endregion Velocity = (Game.GlobalRight * currentHorizontalSpeed) + (Game.GlobalUp * currentVerticalSpeed); }
public override void OnShooting() { shootTime.Update(Game.window.deltaTime * additiveShootSpeed); if (InputMgr.IsPressing("MouseLeft")) { if (shootTime.EndTime()) { Shoot((Up * 10) + (Right * -27)); Shoot((Up * 10) + (Right * 27)); shootTime.Reset(); } } }
public bool OnMouseClick() { if (InputMgr.IsMouseOnArea(startPos, endPos)) { Sprite.scale = new Vector2(1.25f); if (InputMgr.IsReleased("MouseLeft")) { return(true); } } else { Sprite.scale = new Vector2(1f); } return(false); }
public void Input_MouseMovement() { if (InputMgr.IsPressing("Left")) { Sprite.Rotation -= rotationSpeed * Game.window.deltaTime; } else if (InputMgr.IsPressing("Right")) { Sprite.Rotation += rotationSpeed * Game.window.deltaTime; } else { CheckRotation(); } Position = Game.window.mousePosition; }
public void Input_MouseFollowing() { float slowVar = InputMgr.IsPressing("SlowMove") ? 0.5f : 1; #region Left&Right //if (Game.window.GetKey(KeyCode.A)) if (InputMgr.IsPressed("Left")) { currentHorizontalSpeed = -currentSpeed * 2f; } else if (InputMgr.IsPressed("Right")) { currentHorizontalSpeed = currentSpeed * 2f; } else { currentHorizontalSpeed = 0; } #endregion #region Down&UP if (InputMgr.IsPressed("Up")) { currentVerticalSpeed = -currentSpeed; } else if (InputMgr.IsPressed("Down")) { currentVerticalSpeed = currentSpeed; } else { currentVerticalSpeed = 0; } #endregion LookAt(InputMgr.MousePosition); Velocity = ((Game.GlobalRight * currentHorizontalSpeed) + (Game.GlobalUp * currentVerticalSpeed)) * slowVar; }