//主循环函数
void loop()
{
display.clearDisplay();//删除上一个循环
//获取传感器参数
Signal_Shoot = digitalRead(PIN_SENSOR);//0为发射,1为停止
if (Index == 0)
{ //display.drawBitmap(0, 0, logo, 128, 52, 1);
display.setTextSize(1.7);
display.setTextColor(WHITE);
display.setCursor(0, 0); //设置字体的起始位置
display.print("Start-cover infrared");
display.drawBitmap(10, 16, str_4, 32, 30, 1);
display.drawBitmap(42, 16, str_5, 32, 30, 1);
display.drawBitmap(74, 16, str_6, 32, 30, 1);
display.drawBitmap(50, 50, str_1, 16, 16, 1);
display.drawBitmap(66, 50, str_1, 16, 16, 1);
display.drawBitmap(82, 50, str_2, 16, 16, 1);
display.drawBitmap(98, 50, str_3, 16, 16, 1);
InitGame();//游戏初始化
}
if (Index == 1)
{
InGaming();//游戏进行中
Control_Score_Level();//分数与等级控制
}
if (Index == 2)
{
EndGame();//终局控制
}
display.display(); //把缓存的都显示
}
//中文:五 (这就是存储点阵变量,str_1可以修改成自己喜欢的名称,用函数display.drawBitmap()调用就可以了)
static const unsigned char PROGMEM str_1[] =
{
0x00,0x00,0x7F,0xF0,0x04,0x00,0x04,0x00,0