⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 block.h

📁 瑞星微公司RK27XX系列芯片的SDK开发包
💻 H
字号:

#ifndef _IN_BLOCK_H
#define _IN_BLOCK_H
/*
********************************************************************************
    定义游戏基本块的大小
********************************************************************************
*/
#include "..\..\..\System\Include\include.h"
#define BLOCKTIMERDELAY 150
#define BLOCKTIMEDECSIZE 15  //BLOCKTIMEDECSIZE*9必须小于BLOCKTIMERDELAY
#define BASE_BLOCK_XSIZE    12
#define BASE_BLOCK_YSIZE    12


#define BLOCKGAME_DISP_OFFSET_X  40//16
#define BLOCKGAME_DISP_OFFSET_Y  0//16

#define BLOCKGAME_DISP_NEXT_BLOCK_X                           (BLOCKGAME_DISP_OFFSET_X+96+16+32)//208
#define BLOCKGAME_DISP_NEXT_BLOCK_Y                           (32-8+32)

#define BLOCKGAME_DISP_NEXT2_BLOCK_X                           (BLOCKGAME_DISP_OFFSET_X+96+16 +32+60)//208
#define BLOCKGAME_DISP_NEXT2_BLOCK_Y                           (32-8+32)

#define BLOCKGAME_DISP_NEXT3_BLOCK_X                           (BLOCKGAME_DISP_OFFSET_X+96+16 +32+60)//208
#define BLOCKGAME_DISP_NEXT3_BLOCK_Y                           (32-8+60+32)

#define BLOCKGAME_DISP_NEXT4_BLOCK_X                           (BLOCKGAME_DISP_OFFSET_X+96+16 +32+60)//208
#define BLOCKGAME_DISP_NEXT4_BLOCK_Y                           (32-8+120+32)

#define BLOCKGAME_DISP_SCORE_X      (BLOCKGAME_DISP_NEXT_BLOCK_X+2)
#define BLOCKGAME_DISP_SCORE_Y            (BLOCKGAME_DISP_NEXT_BLOCK_Y + BASE_BLOCK_YSIZE*4 + 4)//24+48+4

#define BLOCKGAME_DISP_LEVEL_X      BLOCKGAME_DISP_SCORE_X
#define BLOCKGAME_DISP_LEVEL_Y      (BLOCKGAME_DISP_SCORE_Y + 28)

#define BLOCKGAME_DISP_LINE_X      BLOCKGAME_DISP_SCORE_X
#define BLOCKGAME_DISP_LINE_Y      (BLOCKGAME_DISP_LEVEL_Y + 28)

#define BLOCKGAME_DISP_STATE_X                                     BLOCKGAME_DISP_LINE_X
#define BLOCKGAME_DISP_STATE_Y                                     BLOCKGAME_DISP_LINE_Y

#define BLOCKGAME_STOP           (1<<0)
#define BLOCKGAME_RUN            (1<<1)
#define BLOCKGAME_PAUSE        (1<<2)

#define BLOCK_CHK_NULL      (1<<0)
#define BLOCK_CHK_LEFT      (1<<1)
#define BLOCK_CHK_RIGHT     (1<<2)
#define BLOCK_CHK_DOWN      (1<<3)
#define BLOCK_IMAGE_NULL    0xFFFF
#define BLOCK_LIMIT_MASK    0xE007
/*
********************************************************************************
    定义游戏区域大小
********************************************************************************
*/
#define BLOCKGAME_SCOPE_ROW      20
#define BLOCKGAME_SCOPE_COL      10

UINT32 BlockOnPaint(WINDOW* win , WMPARAM wParam, WLPARAM lParam);
UINT32 BlockOnTimer(WINDOW* win , WMPARAM wParam, WLPARAM lParam);
UINT32 BlockOnKey(WINDOW* win , WMPARAM wParam, WLPARAM lParam);

void BlockDispNext(void);
void BlockDrawGameArea(void);
void BlockValueInit(void);
void BlockDispInit(void);
unsigned int BlockInsert(void);
unsigned int BlockChk(unsigned int mode, unsigned int x, unsigned int y);
void BlockRefLine(unsigned int yy);
void BlockShowScore();
void BlockRemove(void);
unsigned int BlockGetNewBlock(void);
void BlockGameSetting(UINT32 KeyVal);
void BlockMove(unsigned int key);
void BlockGameProcess(UINT32 KeyVal);
void BlockDrawBackground(void);
void BlockFlashLine(unsigned int *yy, unsigned int len);
void BlockDispOneNext(int xx, int yy, int index);
void BlockRefreshNextMat(unsigned int justrefresh);
unsigned int BlockOnDestroy(WINDOW* win, WMPARAM wParam, WLPARAM lParam);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -