-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
63 lines (54 loc) · 1.23 KB
/
main.cpp
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
53
54
55
56
57
58
59
60
61
62
63
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include <time.h>
#include <ctime>
#include "pgui.h"
#include "gamecore.h"
using namespace std;
int main()
{
srand(time(NULL));
/*if(LoadScores()!=0)
{
for(int i=0; i<10; ++i)
{
for(int j=0; j<6; ++j)
{
Names[i][j]=32;
}
HighScores[i]=0;
}
SaveScores();
}*/
LoadScores();
for(int row=0; row<TF_HEIGHT; ++row)
{
for(int col=0; col<TF_WIDTH; ++col)
{
switch(col*row%5)
{
case 0: GameField[row][col]=TILE_EMPTY; break;
case 1: GameField[row][col]=TILE_LGREY; break;
case 2: GameField[row][col]= TILE_GREY; break;
case 3: GameField[row][col]=TILE_DGREY; break;
case 4: GameField[row][col]=TILE_BLACK; break;
}
}
}
while(1) //game cycle
{
if(kbhit() == true)
{
char c=getch();
OnKeyPressed(c);
//InputC=c;
}
if(GStatus==STATE_EXIT)
return 0;
OnFrame();
Refresh();
Sleep(RedrawInterval);
}
}