28 lines
645 B
C
28 lines
645 B
C
|
#ifndef RACKET_H
|
||
|
#define RACKET_H
|
||
|
|
||
|
#include <SDL.h>
|
||
|
|
||
|
typedef struct Racket {
|
||
|
const int RACKET_WIDTH;
|
||
|
const int RACKET_HEIGHT;
|
||
|
const int RACKET_VELOCITY;
|
||
|
const int SCREEN_WIDTH;
|
||
|
const int SCREEN_HEIGHT;
|
||
|
const int posX;
|
||
|
int posY;
|
||
|
const int vel;
|
||
|
int score;
|
||
|
const SDL_Keycode up;
|
||
|
const SDL_Keycode down;
|
||
|
int updown;
|
||
|
} Racket;
|
||
|
|
||
|
Racket* Racket_init(int screen_width, int screen_height, int posX, int posY, SDL_Keycode up, SDL_Keycode down);
|
||
|
void Racket_free(Racket *r);
|
||
|
void Racket_handle_event(Racket *r, const Uint8* keystate);
|
||
|
void Racket_move(Racket *r);
|
||
|
int Racket_render(const Racket *r, SDL_Renderer *renderer);
|
||
|
|
||
|
#endif
|