-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathteste.c
More file actions
33 lines (31 loc) · 744 Bytes
/
teste.c
File metadata and controls
33 lines (31 loc) · 744 Bytes
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
#include <stdio.h>
#include "general.h"
#include "Nave.h"
#include "Defesa.h"
#include "Tiro.h"
#include "Cenario.h"
int main() {
int gameRunning = TRUE;
clock_t start = clock();
int fps = 2;
double timestep = (double) 1 / fps;
initShip();
initCenario();
/*a ideia eh usarmos algo com o timestep e sair quando o usuario
* entrar com EOF ou com Q/<Insira uma letra de preferencia>*/
while (gameRunning)
{
clock_t now = clock();
if (((double) (now - start)) >= timestep)
{
gameRunning = update();
if (ship->vidas == 0) gameRunning = FALSE;
imprimeCenario();
start = now;
}
}
freeShip();
freeCenario();
printf("Fim de execucao!\n");
return 0;
}