mini canvas

This commit is contained in:
2024-03-21 19:30:40 +01:00
parent 8597a9f736
commit 474fce2278
5 changed files with 50 additions and 5 deletions

View File

@ -423,7 +423,25 @@ static uint8_t move(direction_t direction) {
return 0;
}
uint8_t stoneDraw() {
void nextStoneDraw() {
miniCanvasClear();
miniCanvasSetPixel(motions[nextShape].draw[0].x,
motions[nextShape].draw[0].y,
motions[nextShape].color);
miniCanvasSetPixel(motions[nextShape].draw[1].x,
motions[nextShape].draw[1].y,
motions[nextShape].color);
miniCanvasSetPixel(motions[nextShape].draw[2].x,
motions[nextShape].draw[2].y,
motions[nextShape].color);
miniCanvasSetPixel(motions[nextShape].draw[3].x,
motions[nextShape].draw[3].y,
motions[nextShape].color);
}
uint8_t stoneDraw() {
nextStoneDraw();
uint8_t res = 0;
// check if the pixels the shape should be drawn at are free
if (canvasIsPixelFree(stone.x + motions[stone.shape].draw[0].x,