void Game::update() { Point<float> ballCenter = ball->getCenter(); Point<int> ballSize = ball->getSize(); float ballHitboxFactor = ball->getHitboxFactor(); Point<float> paddleCenter[2]; paddleCenter[0] = paddle0->getCenter(); paddleCenter[1] = paddle1->getCenter(); Point<int> paddleSize = paddle0->getSize(); float paddleHBfactor = paddle0->getHitboxFactor(); paddle0->update(); paddle1->update(); // TODO: FINISH THIS LOGIC!!!!!!!!!!! if (checkBallCollision(ballCenter, ballSize, ballHitboxFactor, paddleCenter[0], paddleSize, paddleHBfactor)) { ball->setStatus(HIT_PADDLE); } if (checkBallCollision(ballCenter, ballSize, ballHitboxFactor, paddleCenter[1], paddleSize, paddleHBfactor)) { ball->setStatus(HIT_PADDLE); } ball->update(); }
void SVSlime::onTick(void) { checkBallCollision(); handleInputs(); simplePhysics(); constrainToBounds(); }