It's for those who want to make the player feel different and possibly include some jump puzzles: as soon as the player stops pressing movement keys, they'll stop moving (provided they're also not falling down or flying up).
Code: Select all
#library "MOVESTOP"
#include "zcommon.acs"
Script "Movestop" Enter
{
int buttons;
buttons = GetPlayerInput(-1, INPUT_BUTTONS);
delay(3);
if ( buttons & BT_FORWARD || buttons & BT_BACK || buttons & BT_MOVELEFT || buttons & BT_MOVERIGHT || GetActorVeLZ (0) != 0)
{
restart;
}
else
{
Thing_Stop(0);
}
restart;
}
Now, if somebody could tell me how to make player move at full speed immediately after pressing a movement button instead of gaining it steadily...