MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / landing

Method landing

engine/src/entity.cpp:1069–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067}
1068
1069void Entity::landing()
1070{
1071 if (toMove.y != -1)
1072 toMove.y = 0;
1073 jumpCountDown = JUMPFRAMES;
1074 if (velocity.x > 0)
1075 currentState = CS_MOVINGRIGHT;
1076 else if (velocity.x < 0)
1077 currentState = CS_MOVINGLEFT;
1078 else if (!toMove.x || currentState == CS_FALLING ||
1079 currentState == CS_JUMPING)
1080 currentState = CS_IDLE;
1081}
1082
1083void Entity::advanceAnimationFrame(int elapsedframes, float delaydivider,
1084 int endframe, bool loop)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected