Yang Zhenye 201199680
Dependencies: mbed
Diff: RooneyEngine/RooneyEngine.cpp
- Revision:
- 8:c02c278320c0
- Parent:
- 7:a69ae964412c
- Child:
- 9:a5a82b3d1102
--- a/RooneyEngine/RooneyEngine.cpp Thu May 14 17:19:27 2020 +0000 +++ b/RooneyEngine/RooneyEngine.cpp Thu May 14 18:30:55 2020 +0000 @@ -71,29 +71,29 @@ // lcd.drawRect(_x,_y,_size,_size,FILL_BLACK); // } -void RooneyEngine::update_lcd(N5110 &lcd) { - get_sprite(); - sprintf(buffer,"%2d",_player_score); - lcd.printString("score",0,0); - lcd.printString(buffer,30,0); - } +//void RooneyEngine::update_lcd(N5110 &lcd) { + // get_sprite(); +// sprintf(buffer,"%2d",_player_score); + // lcd.printString("score",0,0); + // lcd.printString(buffer,30,0); + // } -void RooneyEngine::get_rooney_x(Gamepad &gamepad) { - _speed=speed; - if (joy_x < float(-0.5){ - _speed=-0.5; - _player_x=38+_speed; - else if (x<=0){ - _speed = 0 - } - } - if (joy_x > float(0.5){ - _speed=0.5; - _player_x=38+_speed; - else if (x>=80){ - _speed = 0 - } - } +//void RooneyEngine::get_rooney_x(Gamepad &gamepad) { + // _speed=speed; +// if (joy_x < float(-0.5){ + // _speed=-0.5; +// _player_x=38+_speed; +// else if (x<=0){ +// _speed = 0 + // } +// } + // if (joy_x > float(0.5){ + // _speed=0.5; + // _player_x=38+_speed; + // else if (x>=80){ + // _speed = 0 +// } +// } bool RooneyEngine::get_reset_flag() { return _reset_flag; @@ -106,15 +106,15 @@ void RooneyEngine::run_engine(N5110 &lcd, Gamepad &gamepad) { init(); reset(); - check_reset(N5110 &lcd, Gamepad &gamepad); - check_start(N5110 &lcd, Gamepad &gamepad); - check_collision(Gamepad &gamepad); - _player_score=get_score(); - get_sprite(); - update_lcd(N5110 &lcd); + check_reset(lcd, gamepad); + check_start(lcd, gamepad); + check_collision(gamepad); +// _player_score=get_score(); + // get_sprite(); + // update_lcd(lcd); get_reset_flag(); get_start_flag(); - get_rooney_x(Gamepad &gamepad); + // get_rooney_x(gamepad); }