when using the scripting wizard to generate a simple jumping script is there a way to set a jump height? the height that the player jumps now is way to low, i opened up the script in the notepad just see if there is something simple i can change, but scripting isnt my thing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sub Player_OnControllerMove(OldActions, NewActions)
With ProjectObj.GamePlayer.PlayerSprite
If (Not OldActions) And NewActions And ACTION_BUTTON1 Then
If (.rDef.SolidTest(.X, .Y + .Height) Or .rDef.SolidTest(.X + .Width - 1, .Y + .Height)) Or (Not .pRideOnRef Is Nothing) Then
.DY = - .rDef.Template.MoveSpeed
End If
End If
End With
End Sub
is the original code. Change the following line:
.DY = - .rDef.Template.MoveSpeed
To whatever it is that you want the speed to be. Note that that code sets the velocity in the Y direction (.DY) to the negative value of the movement speed of the sprite. If you want to double the jump height, just change it to
.DY = - (.rDef.Template.MoveSpeed * 2)
Or if you want it to be a constant (say, 4)
.DY = -4
Will do the trick.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
when using the scripting wizard to generate a simple jumping script is there a way to set a jump height? the height that the player jumps now is way to low, i opened up the script in the notepad just see if there is something simple i can change, but scripting isnt my thing.
Sub Player_OnControllerMove(OldActions, NewActions)
With ProjectObj.GamePlayer.PlayerSprite
If (Not OldActions) And NewActions And ACTION_BUTTON1 Then
If (.rDef.SolidTest(.X, .Y + .Height) Or .rDef.SolidTest(.X + .Width - 1, .Y + .Height)) Or (Not .pRideOnRef Is Nothing) Then
.DY = - .rDef.Template.MoveSpeed
End If
End If
End With
End Sub
is the original code. Change the following line:
.DY = - .rDef.Template.MoveSpeed
To whatever it is that you want the speed to be. Note that that code sets the velocity in the Y direction (.DY) to the negative value of the movement speed of the sprite. If you want to double the jump height, just change it to
.DY = - (.rDef.Template.MoveSpeed * 2)
Or if you want it to be a constant (say, 4)
.DY = -4
Will do the trick.