73 lines
913 B
C
73 lines
913 B
C
#ifndef MYWIN_SNAKE_H__
|
|
#define MYWIN_SNAKE_H__
|
|
|
|
|
|
#include "main_inc.h"
|
|
#include "snake.h"
|
|
|
|
//定义可以保存的计时组数
|
|
#define STOPWATCH_TIMESAVE_MAX 20
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
WIN_TouchWinStruct win;
|
|
int timerId; //软件定时器id
|
|
snak_struct *snake;
|
|
int suspend; //暂停
|
|
|
|
|
|
WIN_ButtonStruct *but_up;
|
|
WIN_ButtonStruct *but_down;
|
|
WIN_ButtonStruct *but_left;
|
|
WIN_ButtonStruct *but_right;
|
|
|
|
int delay_ms;
|
|
|
|
}WIN_SnakeStruct;
|
|
|
|
|
|
|
|
|
|
|
|
WIN_SnakeStruct *WIN_CreatSnake (WIN_WindowStruct *base,
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
int x,int y,int x_size,int y_size);
|
|
|
|
|
|
|
|
|
|
//删除秒表
|
|
void SNAKE_DeleteSnake (WIN_SnakeStruct *s );
|
|
|
|
|
|
|
|
//消息框的绘制函数
|
|
void SNAKE_DefaultPaint (WIN_SnakeStruct *s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//消息框的消息处理函数
|
|
void SNAKE_defaultMsgLoop (WIN_SnakeStruct *s,WIN_MsgStruct *msg);
|
|
|
|
|
|
|
|
WIN_SnakeStruct *SNAKE_StartGame (WIN_WindowStruct *base);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|