34 lines
646 B
C
34 lines
646 B
C
#ifndef PONG_H
|
|
#define PONG_H
|
|
|
|
#include <SDL.h>
|
|
|
|
#include "ball.h"
|
|
|
|
typedef struct Pong {
|
|
const int SCREEN_WIDTH;
|
|
const int SCREEN_HEIGHT;
|
|
SDL_Window* window;
|
|
SDL_Surface* screenSurface;
|
|
SDL_Renderer* renderer;
|
|
//SDL_Texture* texture;
|
|
SDL_Event e;
|
|
Ball *ball;
|
|
const int BALL_POSX;
|
|
Racket *racketL;
|
|
const int RACKET_POSX;
|
|
Racket *racketR;
|
|
} Pong;
|
|
|
|
Pong* Pong_init();
|
|
void Pong_free(Pong *p);
|
|
void Pong_clear(Pong *p);
|
|
void Pong_render(Pong *p);
|
|
void Ball_move(Ball *b, Pong *p);
|
|
void Pong_run(Pong *p);
|
|
void Pong_score(const Pong *p, char c);
|
|
void Pong_score_run(const Pong *p);
|
|
void Pong_score_end(const Pong *p);
|
|
|
|
#endif
|