This is the first version of a Fishing Mini-game. It uses a navigational switch as a button and a joystick, playing wav files from a SD card, and a uLCD screen to show the fishing game
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player
Diff: Fishing.h
- Revision:
- 1:8dd8fafa7fc8
- Parent:
- 0:5d811b6879d5
--- a/Fishing.h Thu Mar 17 18:33:52 2016 +0000 +++ b/Fishing.h Thu Mar 17 18:47:33 2016 +0000 @@ -22,7 +22,7 @@ oldCnt = 1; } -void Fishing::start() { +void Fishing::start() { //Title Screen stdio_mutex.lock(); uLCD.text_width(1); uLCD.text_height(1); @@ -31,7 +31,7 @@ stdio_mutex.unlock(); } -void Fishing::lake_init() { +void Fishing::lake_init() { //Initial lake or pond stdio_mutex.lock(); uLCD.filled_rectangle(0, 0 , 127, 127, BLACK); for(int i =0; i < 17; i++) { @@ -43,7 +43,7 @@ stdio_mutex.unlock(); } -void Fishing::grass(int x, int y, int n, int color) { +void Fishing::grass(int x, int y, int n, int color) { //Drawing of the grass uLCD.circle(x+2*n-2, y+4*n , n, 0x000042); uLCD.circle(x+2*n+1, y+4*n , n, 0x000042); uLCD.circle(x+2*n-2, y+4*n , n-1, 0x444444); @@ -61,7 +61,7 @@ } } -void Fishing::draw_fish(int x, int dist) { +void Fishing::draw_fish(int x, int dist) { //Drawing of the fish stdio_mutex.lock(); if(oldx != x) { uLCD.filled_circle(oldx, 80 , 4, BLUE); @@ -78,7 +78,7 @@ stdio_mutex.unlock(); } -void Fishing::draw_rod(int n, int x) { +void Fishing::draw_rod(int n, int x) { //Drawing of the fishing rod if (oldCnt != n || oldx2 != x) { stdio_mutex.lock(); uLCD.line(64 + 6*oldCnt,95, 64 + 7*oldCnt, 100, BLUE);