You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Add functional changes to inertia to support only specific directions specified in the config (#671)
* Add functional changes to inertia to support only specific directions specified in the config (needs cleanup) * Reduce number of inertia defines * Update Platform Displacement 2 define description * comment adjustments
This commit is contained in:
@@ -179,11 +179,16 @@ static u8 sInertiaFirstFrame = FALSE;
|
||||
* Apply inertia based on Mario's last platform.
|
||||
*/
|
||||
static void apply_mario_inertia(void) {
|
||||
#ifdef MARIO_INERTIA_UPWARD
|
||||
// On the first frame of leaving the ground, boost Mario's y velocity
|
||||
if (sInertiaFirstFrame) {
|
||||
gMarioState->vel[1] += sMarioAmountDisplaced[1];
|
||||
if (sMarioAmountDisplaced[1] > 0.0f) {
|
||||
gMarioState->vel[1] += sMarioAmountDisplaced[1];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MARIO_INERTIA_LATERAL
|
||||
// Apply sideways inertia
|
||||
gMarioState->pos[0] += sMarioAmountDisplaced[0];
|
||||
gMarioState->pos[2] += sMarioAmountDisplaced[2];
|
||||
@@ -191,6 +196,7 @@ static void apply_mario_inertia(void) {
|
||||
// Drag
|
||||
sMarioAmountDisplaced[0] *= 0.97f;
|
||||
sMarioAmountDisplaced[2] *= 0.97f;
|
||||
#endif
|
||||
|
||||
// Stop applying inertia once Mario has landed, or when ground pounding
|
||||
if (!(gMarioState->action & ACT_FLAG_AIR) || (gMarioState->action == ACT_GROUND_POUND)) {
|
||||
|
||||
Reference in New Issue
Block a user