-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgame.h
More file actions
52 lines (46 loc) · 1.07 KB
/
game.h
File metadata and controls
52 lines (46 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef GAME_H_DEFINED
#define GAME_H_DEFINED
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <ctype.h>
#include <time.h>
#include <windows.h>
#include "helpers.h"
#include "asteroid.h"
#include "bullet.h"
#include "ship.h"
#define START 1
#define GAMEOVER 0
#define PLUSSCORE 10
#define WINDOW_WIDTH 100
#define WINDOW_HEIGHT 30
#define LIMIT_ASTEROIDS 10
#define TITLE "NAVE"
// MAPA
typedef struct{
DIMENSION *dimension;
}MAP;
// GAME
typedef struct{
bool start;
unsigned int score;
unsigned short level;
unsigned char lifes;
unsigned char speed;
unsigned char status;
MAP *map;
ASTEROID *asteroids[LIMIT_ASTEROIDS];
}GAME;
MAP *createMap();
GAME *createGame();
void startGame(GAME *game, SHIP *ship);
void renderScoreboard(GAME *game);
void updateGame(GAME *game, SHIP *ship);
void addAsteroid(GAME *game, SHIP *ship, unsigned short index);
void removeAsteroid(GAME *game, unsigned short index);
bool hasColision(POSITION *p1, POSITION *p2);
void createExplosion(POSITION *position);
void menu(GAME *game, SHIP *ship);
void gameover(GAME *game);
#endif