#include "GameBoy.h"
GameBoy gb;
int xFood = 3;int yFood = 3;
int x = 5; int y = 5;
int lenTail = 0;
int xTail[8*8*2];
int yTail[8*8*2];
int score=0;
void setup() {
gb.begin(0);
Serial.begin(9600);
}
void loop() {// Serial.println(gb.getKey());
if(x==xFood and y==yFood) {
score++;
xFood=random(7+1); yFood=random(8*2);
}
for(int i=0; i<sco)
gb.clearDisplay();
gb.setLed(xFood,yFood,true);
gb.setLed(x,y,true);//вімкнути піксель за кординатами
if(gb.getKey()==5 and x<7) x++;
if(gb.getKey()==4 and x>0) x--;
if(gb.getKey()==6 and y<15) y++;
if(gb.getKey()==3 and y>0) y--;
delay(100);
}