-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.c
38 lines (31 loc) · 967 Bytes
/
main.c
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
#include<stdio.h>
#include<math.h>
#include<time.h>
#include<Windows.h>
#include "./cnsglib/include/cnsg.h"
#include "./include/common.h"
#include "./include/race.h"
#include "./include/title.h"
#include "./include/menu.h"
#include "./include/bestTime.h"
FontSJIS shnm12, shnm16b;
Image carImage;
Node stageNode, courseNode;
Shape carShape, carCollisionShape;
WindowManager *rootManager;
float bestTime;
static void initGame(void) {
shnm12 = initFontSJIS(loadBitmap("assets/shnm6x12r.bmp", NULL_COLOR), loadBitmap("assets/shnmk12.bmp", NULL_COLOR), 6, 12, 12);
shnm16b = initFontSJIS(loadBitmap("assets/shnm8x16rb.bmp", NULL_COLOR), loadBitmap("assets/shnmk16b.bmp", NULL_COLOR), 8, 16, 16);
loadBestTime(&bestTime, "./bestTime/bestTime.dat");
initRace();
initTitle();
initMenu();
}
int main(int argc, char *argv[]) {
rootManager = initCNSG(argc, argv, SCREEN_WIDTH, SCREEN_HEIGHT);
initGame();
startTitle();
gameLoop(FRAME_PER_SECOND);
return 0;
}