#include #include Gamebuino gb; void setup() { gb.begin(); } void loop() { float x = 20, y = 20, angle = 0; while (1) { if (gb.update()) { if (gb.buttons.repeat(BTN_RIGHT, 1)) { angle += 0.31415 / 2; } if (gb.buttons.repeat(BTN_LEFT, 1)) { angle -= 0.31415 / 2; } if (gb.buttons.repeat(BTN_A, 1)) { x += cos(angle) * 0.5; y += sin(angle) * 0.5; } gb.display.cursorX = 0; gb.display.cursorY = 0; gb.display.print(angle); gb.display.cursorX = 0; gb.display.cursorY = 6; gb.display.print(x); gb.display.cursorX = 0; gb.display.cursorY = 12; gb.display.print(y); gb.display.fillTriangle(x, y, x - cos(angle) * 8, y - sin(angle) * 8, x - cos(angle - 0.8) * 8, y - sin(angle - 0.8) * 8); gb.display.setColor(WHITE); gb.display.drawPixel(x - cos(angle - 0.25) * 3, y - sin(angle - 0.25) * 3); gb.display.setColor(BLACK); } } }