Skip to content

Commit

Permalink
Merge pull request #36 from meronmks/NitroPath2
Browse files Browse the repository at this point in the history
ニトロがキーボード操作で干渉しないように
  • Loading branch information
TORISOUP committed Nov 16, 2015
2 parents 8af275f + 495fd70 commit a175d5c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Inferno/InfernoScripts/InfernoCore/Enums/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public enum GameKey
RStickUp = 3,
RStickDown = 4,
RStickLeft = 5,
RStickRight = 6
RStickRight = 6,
VehicleAccelerateKey = 232,
VehicleForwardTiltKey = 209,
VehicleBackwardTiltKey = 224

};

Expand Down
14 changes: 12 additions & 2 deletions Inferno/InfernoScripts/Player/PlayerVehicleNitro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,18 @@ private void NitroVehicle()
return;
}

//車体回転時用にスティック入力を-127~127で取得して-0.5~0.5の値になるように調整
var rotation = this.GetStickValue().Y / 250.0f;

float rotation;
if (this.IsGamePadPressed(GameKey.VehicleAccelerateKey))
{
rotation = this.IsGamePadPressed(GameKey.VehicleForwardTiltKey) ? 0.5f : 0.0f;
}
else
{
//車体回転時用にスティック入力を-127~127で取得して-0.5~0.5の値になるように調整
rotation = this.GetStickValue().Y / 250.0f;
}

if (Game.Player.WantedLevel == 0)
{
vehicle.Quaternion = Quaternion.RotationAxis(vehicle.RightVector, rotation) * vehicle.Quaternion;
Expand Down

0 comments on commit a175d5c

Please sign in to comment.