summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-11-03 11:18:54 -0400
committerGitHub <noreply@github.com>2021-11-03 11:18:54 -0400
commitb16b91826665c500500fe1b2bf4db386ce01152a (patch)
tree8325fc94e4353512757c25a3c7e23263db9ab40e /src
parentc98fbb5ca6edf4f2bb3d2eada318082051f0849d (diff)
parentfca863244b9097c79dba14154eaeb3719c91bfbe (diff)
Merge pull request #1541 from cbt6/move-speed
Use constants for movement speeds
Diffstat (limited to 'src')
-rw-r--r--src/event_object_movement.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/event_object_movement.c b/src/event_object_movement.c
index 1bb4991ab..593200893 100644
--- a/src/event_object_movement.c
+++ b/src/event_object_movement.c
@@ -5184,7 +5184,7 @@ static void InitMovementNormal(struct ObjectEvent *objectEvent, struct Sprite *s
static void StartRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction)
{
- InitNpcForMovement(objectEvent, sprite, direction, 1);
+ InitNpcForMovement(objectEvent, sprite, direction, MOVE_SPEED_FAST_1);
SetStepAnimHandleAlternation(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection));
}
@@ -8349,15 +8349,19 @@ static const SpriteStepFunc sStep8Funcs[] = {
};
static const SpriteStepFunc *const sNpcStepFuncTables[] = {
- sStep1Funcs,
- sStep2Funcs,
- sStep3Funcs,
- sStep4Funcs,
- sStep8Funcs,
+ [MOVE_SPEED_NORMAL] = sStep1Funcs,
+ [MOVE_SPEED_FAST_1] = sStep2Funcs,
+ [MOVE_SPEED_FAST_2] = sStep3Funcs,
+ [MOVE_SPEED_FASTER] = sStep4Funcs,
+ [MOVE_SPEED_FASTEST] = sStep8Funcs,
};
static const s16 sStepTimes[] = {
- 16, 8, 6, 4, 2
+ [MOVE_SPEED_NORMAL] = 16,
+ [MOVE_SPEED_FAST_1] = 8,
+ [MOVE_SPEED_FAST_2] = 6,
+ [MOVE_SPEED_FASTER] = 4,
+ [MOVE_SPEED_FASTEST] = 2,
};
static bool8 NpcTakeStep(struct Sprite *sprite)