c-pong/include/player.h

26 lines
508 B
C
Raw Normal View History

2023-10-06 15:30:56 +00:00
#ifndef PLAYER_H
#define PLAYER_H
#define PLAYER_WIDTH 25
#define PLAYER_HEIGHT 250
#define PLAYER_SPEED 6000.0
struct player
{
int x_location;
int y_location;
int speed;
};
enum player_move_dir
{
PLAYER_MOVE_UP,
PLAYER_MOVE_DOWN,
};
void player_move(struct player* player, float dt, enum player_move_dir dir);
void player_update(struct game_data* data, struct player* player, float dt);
struct player* player_init(int x_location, int move_limit, int speed);
#endif /* PLAYER_H */