A_BunnyHop is an action that checks if the actor is on the ground, and if so, makes the actor jump up and forward. Var1 specifies the strength of the upward thrust, Var2 specifies the strength of the forward thrust. In SRB2, this action is used by the bunnies (after which it is named) and chickens that spawn out of destroyed enemies, the Pogminz, the water Pogminz, the Pog-GX2 and the Robo-Hood.
Code – A_BunnyHop
// Function: A_BunnyHop
// Description: Makes object hop like a bunny.
// var1 = jump strength
// var2 = horizontal movement
void A_BunnyHop(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_BunnyHop", actor))
if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz)
|| (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz))
P_SetObjectMomZ(actor, locvar1*FRACUNIT, false);
P_InstaThrust(actor, actor->angle, FixedMul(locvar2*FRACUNIT, actor->scale)); // Launch the hopping action! PHOOM!!