A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.
Dependencies: mbed MotionSensor
Diff: RoomEngine/RoomEngine.cpp
- Revision:
- 46:f09711580d4a
- Parent:
- 45:8725b4171646
- Child:
- 47:6e31b195ce3c
diff -r 8725b4171646 -r f09711580d4a RoomEngine/RoomEngine.cpp --- a/RoomEngine/RoomEngine.cpp Wed May 08 12:40:52 2019 +0000 +++ b/RoomEngine/RoomEngine.cpp Wed May 08 20:47:52 2019 +0000 @@ -2,8 +2,8 @@ // Constructor RoomEngine::RoomEngine(float global_contrast) { - _room_x = 5; - _room_y = 5; + _room_x = MAX_ROOMS_MAP_X / 2; + _room_y = MAX_ROOMS_MAP_Y / 2; _global_contrast = global_contrast; } @@ -20,6 +20,7 @@ room = current_room; set_input(0,0,0,0,0,0,0,0); update_player_position(check_player_room_position()); + room->load(); } void RoomEngine::entrance_scene(N5110 &lcd, Gamepad &gamepad) @@ -81,13 +82,13 @@ { switch(check_player_room_position()) { case 0 : - _room_y++; + _room_y--; break; case 1 : _room_x++; break; case 2 : - _room_y--; + _room_y++; break; case 3 : _room_x--; @@ -120,7 +121,6 @@ void RoomEngine::render(N5110 &lcd, Gamepad &gamepad) { - minimap_detection(lcd, gamepad); pause_detection(lcd, gamepad); lcd.clear(); draw(lcd); @@ -366,15 +366,6 @@ } } -void RoomEngine::minimap_detection(N5110 &lcd, Gamepad &gamepad) -{ - while(gamepad.check_event(Gamepad::BACK_PRESSED)) { - lcd.clear(); - lcd.refresh(); - wait_ms(1000/40); - }; -} - void RoomEngine::pause_detection(N5110 &lcd, Gamepad &gamepad) { if(gamepad.check_event(Gamepad::START_PRESSED)) {