Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FXOS8700CQ mbed-rtos
Diff: Characters/Charmander.cpp
- Revision:
- 10:adff3c804985
- Parent:
- 9:1395c98b58fc
- Child:
- 11:5a6b9dffd78a
--- a/Characters/Charmander.cpp Thu Apr 11 16:17:38 2019 +0000 +++ b/Characters/Charmander.cpp Fri Apr 12 17:19:14 2019 +0000 @@ -17,35 +17,35 @@ void Charmander::draw_cha1_sprite(int pos_x, int pos_y,N5110 &lcd) { - static int charmander_data[] = { - 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0, - 0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0, - 0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0, - 0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0, - 1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1, - 1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1, - 1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,1,1,0, - 0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0, - 0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0, - 0,0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,0,1,0,0,0, - 0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0, - 0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0, - 0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0, - 0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0, - 0,0,0,0,0,0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, 18, 21, (int *)charmander_data); } void Charmander::evo_1_sprite(N5110 &lcd) { - static int evo_1_sprite_data[] = { + static int data[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, @@ -88,12 +88,12 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,1,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0 }; - lcd.drawSprite(34, 8, 38, 41, evo_1_sprite_data); + lcd.drawSprite(34, 8, 41, 38, data); } void Charmander::evo_2_sprite(N5110 &lcd) { - static int evo_2_sprite_data[] = { + static int data[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, @@ -142,12 +142,12 @@ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,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,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0, @@ -171,12 +171,12 @@ }; _x = x; _y = y; - lcd.drawSprite(x, y, 20, 154, evo_3_sprite_data); + lcd.drawSprite(x, y, 20, 154, data); } void Charmander::evo_1_cong(N5110 &lcd) { - static int evo_1_sprite_data[] = { + static int data[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -226,12 +226,12 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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Sprite(0, 0, 48, 84, evo_2_sprite_data); + lcd.drawSprite(0, 0, 48, 84, data); } - +void Charmander::evo_3_cong(N5110 &lcd) +{ + +} void Charmander::description(Gamepad &pad, N5110 &lcd) { @@ -330,6 +333,7 @@ lcd.printString("Press B",0,5); lcd.refresh(); wait(1.0f/fps); + break; } } } \ No newline at end of file