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
Diff: snake_engine/snake_engine.cpp
- Revision:
- 21:7f7d09a27cc8
- Parent:
- 20:980b37fde361
- Child:
- 22:6dce4175795a
--- a/snake_engine/snake_engine.cpp Tue May 08 13:41:08 2018 +0000 +++ b/snake_engine/snake_engine.cpp Tue May 08 13:52:22 2018 +0000 @@ -57,7 +57,8 @@ (_f_pos.y <= _s_pos.y || _f_pos.y+1 == _s_pos.y-1) && (_f_pos.x >= _s_pos.x || _f_pos.x+1 >= _s_pos.x || _f_pos.x+1 >= _s_pos.x ) && (_f_pos.x <= _s_pos.x || _f_pos.x+1 <= _s_pos.x)) { - + //audio feedback. From Pong.engine sample code. + pad.tone(1000.0,0.1); return true; } else { return false; @@ -82,7 +83,9 @@ Vector2D _s_poss = s.get_pos(); if (((_s_poss.x >= WIDTH -2) || (_s_poss.x <= 1)) ||((_s_poss.y >= HEIGHT -1) || (_s_poss.y <= 8)) ) { lcd.clear(); - clision = 1;//if the snake position on X and Y equal to the wall. then it happens. clision = 1. + clision = 1;//if the snake position on X and Y equal to the wall. then it happens. clision = 1. + //audio feedback. From pong.engine samplecode + pad.tone(1500.0,0.5); } }