MCPcopy Create free account
hub / github.com/EasyRPG/Player / Update

Method Update

src/game_character.cpp:127–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void Game_Character::Update() {
128 if (!IsActive() || IsProcessed()) {
129 return;
130 }
131 SetProcessed(true);
132
133 if (IsStopping()) {
134 this->UpdateNextMovementAction();
135 }
136 UpdateFlash();
137
138 if (IsStopping()) {
139 if (GetStopCount() == 0 || IsMoveRouteOverwritten() ||
140 ((Main_Data::game_system->GetMessageContinueEvents() || !Game_Map::GetInterpreter().IsRunning()) && !IsPaused())) {
141 SetStopCount(GetStopCount() + 1);
142 }
143 } else if (IsJumping()) {
144 static const int jump_speed[] = {8, 12, 16, 24, 32, 64};
145 auto amount = jump_speed[GetMoveSpeed() -1 ];
146 this->UpdateMovement(amount);
147 } else {
148 int amount = 1 << (1 + GetMoveSpeed());
149 this->UpdateMovement(amount);
150 }
151
152 this->UpdateAnimation();
153}
154
155void Game_Character::UpdateMovement(int amount) {
156 SetRemainingStep(GetRemainingStep() - amount);

Callers

nothing calls this directly

Calls 5

UpdateMovementMethod · 0.95
UpdateAnimationMethod · 0.95
IsRunningMethod · 0.80

Tested by

no test coverage detected