Chris Dick
/
Gameduino_Rotate_demo
Sprite rotation demo for the Gameduino
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "GD.h" 00003 #include "r.h" 00004 #include "shield.h" 00005 00006 GDClass GD(ARD_MOSI, ARD_MISO, ARD_SCK, ARD_D9, USBTX, USBRX) ; 00007 00008 int main() 00009 { 00010 int i; 00011 00012 GD.begin(); 00013 GD.ascii(); 00014 GD.putstr(0, 0,"Sprite rotation"); 00015 00016 GD.copy(RAM_SPRIMG, r_img, sizeof(r_img)); 00017 GD.copy(RAM_SPRPAL, r_pal, sizeof(r_pal)); 00018 00019 for (i = 0; i < 8; i++) { 00020 char msg[] = "ROT=."; 00021 byte y = 3 + 4 * i; 00022 msg[4] = '0' + i; 00023 GD.putstr(18, y, msg); 00024 GD.sprite(i, 200, 8 * y, 0, 0, i); 00025 } 00026 } 00027
Generated on Tue Jul 19 2022 20:54:35 by 1.7.2