test avoid bulled game
Dependencies: C12832_lcd LCD_fonts mbed mbed-rtos
Revision 53:2dbce16ffdaa, committed 2016-12-14
- Comitter:
- th_mbed
- Date:
- Wed Dec 14 03:02:34 2016 +0000
- Parent:
- 52:2115e13cd9d5
- Child:
- 57:873b89862cfb
- Commit message:
- sss
Changed in this revision
Stage.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Stage.cpp Tue Dec 13 14:34:27 2016 +0000 +++ b/Stage.cpp Wed Dec 14 03:02:34 2016 +0000 @@ -43,9 +43,19 @@ } int Stage::nextStep(){ + if(stage[LCD_X - 1] == 0){ + int t = rand()%6; + if(t % 2==0){ + t++; + } + return t; + } if(stage[LCD_X - 1] == stage[LCD_X - 2 - ONE_STEP_SIZE]){ return stage[LCD_X - 1] + 4; }else{ + if(rand()%10 == 0){ + return 0; + } int start = stage[LCD_X - 1] - 8; if(start < 0){ start = 0;