This script allows the player to control jumping height exactly like Mario Brothers, Revenge of Shinobi and similar platform games.
Note I recorded the demo video live and it has some volume issues, my apologies.
Note I recorded the demo video live and it has some volume issues, my apologies.
Use
- Place this function in the player model's
onmoveascript
. I recommend you keep the file separate and use the#import
directive. - Execute the function in
main()
. Supply it with the calling entity. - The entity's jump height (to its normal maximum) is now tied to length of Jump button press.
Example
C:
#import "data/scripts/dc_mario_height_control.c"
void main()
{
void acting_entity = getlocalvar("self");
/*
* Stop upward momentum if player releases jump key.
*/
dc_mario_height_control(acting_entity);
}