Library that draws a basket on a Nokia N5110 LCD display and allows it to be moved left/right on the display using buttons or a joystick.
Dependents: Game_Controller_Project
Diff: Basket.cpp
- Revision:
- 7:7b71dd93b2f8
- Parent:
- 6:2aec1ed2a75a
- Child:
- 8:48c5adc809e1
--- a/Basket.cpp Fri Mar 31 13:42:55 2017 +0000 +++ b/Basket.cpp Tue Apr 04 16:31:21 2017 +0000 @@ -31,7 +31,7 @@ void Basket::move(Direction d, float mag, Gamepad &pad) { - stick_speed = int(mag*8.0f); + stick_speed = int(mag*10.0f); if (d == E) { x_ref += stick_speed; @@ -39,14 +39,6 @@ x_ref -= stick_speed; } - bumper_speed = 5; - - if (pad.check_event(Gamepad::R_PRESSED)) { - x_ref += bumper_speed; - } else if (pad.check_event(Gamepad::L_PRESSED)) { - x_ref -= bumper_speed; - } - if (x_ref < 1) { x_ref = 1; }