test avoid bulled game
Dependencies: C12832_lcd LCD_fonts mbed mbed-rtos
Diff: Person.cpp
- Revision:
- 12:c74115744b24
- Parent:
- 8:2fd3eedcde64
- Child:
- 13:70e31c1d8205
--- a/Person.cpp Mon Dec 05 08:15:53 2016 +0000 +++ b/Person.cpp Mon Dec 05 12:01:14 2016 +0000 @@ -8,7 +8,8 @@ jump_time = 0; } -point Person::update(int height){ +point Person::update(int h){ + int height = LCD_Y - h - 1; if(jump_time > 0){ //while jumpping p.y -= JUMP_SIZE; @@ -20,7 +21,7 @@ jump_count = 0; }else{ //while down - p.y += JUMP_SIZE + p.y += JUMP_SIZE; } } return p; @@ -37,5 +38,5 @@ } bool Person::isGround(int height){ - return height == p.y; + return height == (p.y + HERSON_SIZE - 1); } \ No newline at end of file