pong/src/ball.h

29 lines
584 B
C

#ifndef BALL_H
#define BALL_H
#include <SDL.h>
#include <stdbool.h>
#include "racket.h"
typedef struct Ball {
const int BALL_WIDTH;
const int BALL_HEIGHT;
const int BALL_VELOCITY;
const int SCREEN_WIDTH;
const int SCREEN_HEIGHT;
int posX;
int posY;
int velX;
int velY;
} Ball;
Ball* Ball_init(int screen_width, int screen_height);
void Ball_reset(Ball *b, int direction);
void Ball_free(Ball *b);
//void Ball_handle_event(Ball *b, SDL_Event *e);
int Ball_collision(const Ball *b, const Racket *r);
int Ball_render(const Ball *b, SDL_Renderer *renderer);
#endif