This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/MCU/MCU_REAL _FINAL/block.h

37 lines
559 B
C
Raw Normal View History

#ifndef _BLOCK_H_
#define _BLOCK_H_
2022-06-06 06:27:04 +00:00
#include <stdlib.h>
2022-06-06 06:27:04 +00:00
#include <string.h>
#include "button.h"
#define MAX_X 8
#define MAX_Y 12
enum BLK_TP {none,two_h,two_v,three_l,three_r,three_h,three_v,four};
//<2F><> <20><EFBFBD><E1B9B9>
struct _dot
{
unsigned char x;
unsigned char y;
} ;
typedef struct _dot Dot;
//<2F><> <20><EFBFBD><E1B9B9>
struct _group
{
enum BLK_TP type; //<2F><><EFBFBD><EFBFBD>
Dot mother;
};
typedef struct _group Group;
void blockInit();
2022-06-06 06:27:04 +00:00
void blockDestroy();
void genPiece();
void dropPiece();
void drawBlock();
2022-06-06 06:27:04 +00:00
void moveLeftPiece();
void moveRightPiece();
void judgeBlock();
#endif