MCPcopy Create free account
hub / github.com/axmolengine/axmol / doStep

Method doStep

tests/cpp-tests/Source/TouchesTest/TouchesTest.cpp:129–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void PongLayer::doStep(float delta)
130{
131 _ball->move(delta);
132
133 for (auto&& paddle : _paddles)
134 {
135 _ball->collideWithPaddle(paddle);
136 }
137
138 if (_ball->getPosition().y > VisibleRect::top().y - kStatusBarHeight + _ball->radius())
139 resetAndScoreBallForPlayer(kLowPlayer);
140 else if (_ball->getPosition().y < VisibleRect::bottom().y - _ball->radius())
141 resetAndScoreBallForPlayer(kHighPlayer);
142}
143
144#define _Info_Formatter "Current force value : {:.02f}, maximum possible force : {:.02f}"
145char formatBuffer[256] = {

Callers

nothing calls this directly

Calls 5

topFunction · 0.85
collideWithPaddleMethod · 0.80
radiusMethod · 0.80
moveMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected