2025-06-27 00:32:57 +08:00
|
|
|
|
#ifndef MYWIN_SNAKE_H__
|
|
|
|
|
|
#define MYWIN_SNAKE_H__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "main_inc.h"
|
|
|
|
|
|
#include "snake.h"
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>ļ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
#define STOPWATCH_TIMESAVE_MAX 20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_TouchWinStruct win;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int timerId; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>id
|
2025-06-27 00:32:57 +08:00
|
|
|
|
snak_struct *snake;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int suspend; //<2F><>ͣ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void SNAKE_DeleteSnake (WIN_SnakeStruct *s );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD>Ļ<EFBFBD><C4BB>ƺ<EFBFBD><C6BA><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void SNAKE_DefaultPaint (WIN_SnakeStruct *s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void SNAKE_defaultMsgLoop (WIN_SnakeStruct *s,WIN_MsgStruct *msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_SnakeStruct *SNAKE_StartGame (WIN_WindowStruct *base);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|