/* 把此文件保存为mazeMain.c
* 描述 : 超级迷宫 (Super Maze)
* 作者 : 文曦畅 Wen Xichang 2004-11-10
*/
#define UP 0x4800
#define DOWN 0x5000
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define KEY_W 0x1157
#define KEY_w 0x1177
#define KEY_S 0x1f53
#define KEY_s 0x1f73
#define KEY_A 0x1e41
#define KEY_a 0x1e61
#define KEY_D 0x2044
#define KEY_d 0x2064
#define ENTER 0x1c0d
#define SPACE 0x3920
#define F1 0x3b00
#define ESC 0x11b
#include <stdio.h>
#include <graphics.h>
#include <stdlib.h>
#include <bios.h>
#include "crtMaze.c"
#include "menu.c"
#include "logo.c"
#include "music.c"
int playerNum = 1;
int gameLevel = 0;
char reachIdx[75][97];
void initMaze (int flag);
void initGrphErrExit (void);
void playGame (void);
void updateThe (Index idx);
void updateRect (Index idx, int len);
void mazeUpdateEx (Index p1, Index p2);
void initMaze(int flag){
int i,j;
for(i = 0; i < maxIdxY; i++){
for(j = 0; j < maxIdxX; j++){
maze[i][j] = 0;
if(gameLevel == 0) reachIdx[i][j] = 1;
else reachIdx[i][j] = 0;
if((i == 0) || (j == 0) || (i == maxIdxY - 1) || (j == maxIdxX - 1)){
maze[i][j] = 1;
}
else if((i % 2 == 0) && (j % 2 == 0)){
maze[i][j] = 1;
}
}
}
if (flag == 0)
randomize();
}
void initGrphErrExit (void){
int gd = VGA, gm = VGAHI, errorcode;
/*registerbgidriver(EGAVGA_driver);*/
initgraph(&gd, &gm, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("\nGraphics error: %s\n", grapherrormsg(errorcode));
printf("\nI am sorry that an error occurred.\n\n");
printf("\t\tPress any key to exit...");
getch();
exit(0);
}
}
* 描述 : 超级迷宫 (Super Maze)
* 作者 : 文曦畅 Wen Xichang 2004-11-10
*/
#define UP 0x4800
#define DOWN 0x5000
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define KEY_W 0x1157
#define KEY_w 0x1177
#define KEY_S 0x1f53
#define KEY_s 0x1f73
#define KEY_A 0x1e41
#define KEY_a 0x1e61
#define KEY_D 0x2044
#define KEY_d 0x2064
#define ENTER 0x1c0d
#define SPACE 0x3920
#define F1 0x3b00
#define ESC 0x11b
#include <stdio.h>
#include <graphics.h>
#include <stdlib.h>
#include <bios.h>
#include "crtMaze.c"
#include "menu.c"
#include "logo.c"
#include "music.c"
int playerNum = 1;
int gameLevel = 0;
char reachIdx[75][97];
void initMaze (int flag);
void initGrphErrExit (void);
void playGame (void);
void updateThe (Index idx);
void updateRect (Index idx, int len);
void mazeUpdateEx (Index p1, Index p2);
void initMaze(int flag){
int i,j;
for(i = 0; i < maxIdxY; i++){
for(j = 0; j < maxIdxX; j++){
maze[i][j] = 0;
if(gameLevel == 0) reachIdx[i][j] = 1;
else reachIdx[i][j] = 0;
if((i == 0) || (j == 0) || (i == maxIdxY - 1) || (j == maxIdxX - 1)){
maze[i][j] = 1;
}
else if((i % 2 == 0) && (j % 2 == 0)){
maze[i][j] = 1;
}
}
}
if (flag == 0)
randomize();
}
void initGrphErrExit (void){
int gd = VGA, gm = VGAHI, errorcode;
/*registerbgidriver(EGAVGA_driver);*/
initgraph(&gd, &gm, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("\nGraphics error: %s\n", grapherrormsg(errorcode));
printf("\nI am sorry that an error occurred.\n\n");
printf("\t\tPress any key to exit...");
getch();
exit(0);
}
}