![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Early commits of my project
Dependencies: mbed Gamepad N5110
Diff: sprites.cpp
- Revision:
- 6:6294bf4eafc8
- Parent:
- 5:f09602591ad3
--- a/sprites.cpp Wed Mar 13 15:23:03 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -void minerbitmap() -{ - const int miner[13][5] = { - 0,0,0,1,1, - 0,1,1,1,1, - 0,1,0,1,0, - 0,1,1,1,1, - 0,1,1,1,0, - 0,0,1,0,0, - 1,1,1,1,1, - 1,1,1,1,1, - 1,1,1,1,1, - 0,1,1,1,0, - 0,1,0,1,0, - 0,1,1,1,1, - }; - - lcd.clear(); - - - Direction d = pad.get_direction(); - printf("Direction = %i\n",d); - - lcd.drawSprite(WIDTH/2 + x,HEIGHT/2 + y,13,5,(int *)miner); - - - if (d==3) { - - x = x+1; - lcd.refresh(); - wait(0.05); - - } - - if (d == 7) { - - x = x-1; - lcd.refresh(); - wait(0.05); - } - //lcd.drawSprite(WIDTH/2 + x,HEIGHT/2 + y,13,5,(int *)miner); - //lcd.refresh(); - - if(pad.check_event(Gamepad::A_PRESSED)) { - - - printf("A pressed"); - y = y - 6; - lcd.clear(); - lcd.drawSprite(WIDTH/2 + x,HEIGHT/2 + y,13,5,(int *)miner); - lcd.refresh(); - wait(0.2); - y= y + 6; - } - - - -}