bouncing_ball backend
Fork of bouncing_ball by
Diff: bouncing_ball.cpp
- Revision:
- 4:73a00b0667fc
- Parent:
- 3:30b5a3adc15f
--- a/bouncing_ball.cpp Tue Nov 07 14:28:53 2017 +0000 +++ b/bouncing_ball.cpp Thu Nov 09 14:26:55 2017 +0000 @@ -53,14 +53,14 @@ void physics_ball::update(float time_step, MMA8452Q& accelerometer) { //If upside down, hold ball still. - if (accelerometer.readZ() < 0) { + /*if (accelerometer.readZ() < 0) { if (_upside_down_status == 0) { _reset_upside_down(); _upside_down_status = 1; } } else { _upside_down_status = 0; - + */ // Make circle bounce off of edges if at the edges: if (( posx <= radius) || ((posx + radius) >= _width)) { speedx = -speedx; @@ -91,10 +91,10 @@ //Report out position is expected in integers, however. posx = (int) _posx_f; posy = (int) _posy_f; - } + //} } -void physics_ball::_reset_upside_down() +void physics_ball::reset_upside_down() { //Increment color when the accelerometer turned upside down. //It's up to the main code to interpret the color.