start refactoring pong entities to use classes

This commit is contained in:
andrea
2026-03-17 20:11:21 +01:00
parent c774e11923
commit d8efabd6da
5 changed files with 194 additions and 0 deletions

21
src/ball.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef PLAYER_H
#define PLAYER_H
#include <stdint.h>
#include "config.h"
class Ball {
private:
uint8_t _x, _y;
int8_t _direction_x, _direction_y;
public:
void move();
void bounce_on_pad();
void bounce_on_sides();
void reset_position ();
uint8_t get_x();
uint8_t get_y();
};
#endif