first bot implementation

bot is now able to automatically move, but for now is too skilled, i need to reduce his skills
This commit is contained in:
andrea
2026-03-19 18:49:58 +01:00
parent eac8c59d96
commit 69a8fb9dc4
4 changed files with 25 additions and 5 deletions

View File

@@ -62,8 +62,10 @@ void Engine::run() {
bool Engine::control_players() {
bool need_refresh= false;
need_refresh |= _p1.check_pad_movement();
need_refresh |= _p2.check_pad_movement();
if (_p1.is_human()) need_refresh |= _p1.check_pad_movement();
else need_refresh |= _p1.check_pad_movement(_ball);
if (_p2.is_human()) need_refresh |= _p2.check_pad_movement();
else need_refresh |= _p2.check_pad_movement(_ball);
return need_refresh;
}