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

Method GetAltitude

src/game_vehicle.cpp:139–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139int Game_Vehicle::GetAltitude() const {
140 if (!IsFlying())
141 return 0;
142 else if (IsAscending())
143 return (SCREEN_TILE_SIZE - data()->remaining_ascent) / (SCREEN_TILE_SIZE / TILE_SIZE);
144 else if (IsDescending())
145 return data()->remaining_descent / (SCREEN_TILE_SIZE / TILE_SIZE);
146 else
147 return SCREEN_TILE_SIZE / (SCREEN_TILE_SIZE / TILE_SIZE);
148}
149
150int Game_Vehicle::GetScreenY(bool apply_jump) const {
151 return Game_Character::GetScreenY(apply_jump) - GetAltitude();

Callers 2

DrawMethod · 0.80
testInitVehicleFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected