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:
- 42:cdcda895cb1b
- Parent:
- 41:0697508a28ba
- Child:
- 43:63f5c9d9689c
diff -r 0697508a28ba -r cdcda895cb1b RoomEngine/RoomEngine.cpp --- a/RoomEngine/RoomEngine.cpp Tue May 07 17:02:30 2019 +0000 +++ b/RoomEngine/RoomEngine.cpp Tue May 07 18:16:42 2019 +0000 @@ -300,24 +300,24 @@ void RoomEngine::check_walls_collision() { - // Enemy - for (int i = 0; i < MAX_ENEMIES; i++) { - if(room->valid_enemies[i]) { - room->enemies[i]->undo_move_x(entity_move_check_x(room->enemies[i], room->walls, 2, 10, room->valid_walls)); - room->enemies[i]->undo_move_y(entity_move_check_y(room->enemies[i], room->walls, 2, 10, room->valid_walls)); - } - } - // Player - player->undo_move_x(entity_move_check_x(player, room->walls, 2, 10, room->valid_walls)); - player->undo_move_y(entity_move_check_y(player, room->walls, 2, 10, room->valid_walls)); - // Bullets - for (int i = 0; i < bullets_max; i++) { - for (int j = 0; j < 2; j++) { - if ((player->valid_bullets[i]) && (room->valid_walls[j]) && (entity_collision(*player->bullets_array[i], *room->walls[j]))) { - delete player->bullets_array[i]; player->valid_bullets[i] = false; - } - } - } +// // Enemy +// for (int i = 0; i < MAX_ENEMIES; i++) { +// if(room->valid_enemies[i]) { +// room->enemies[i]->undo_move_x(entity_move_check_x(room->enemies[i], room->walls, 2, 10, room->valid_walls)); +// room->enemies[i]->undo_move_y(entity_move_check_y(room->enemies[i], room->walls, 2, 10, room->valid_walls)); +// } +// } +// // Player +// player->undo_move_x(entity_move_check_x(player, room->walls, 2, 10, room->valid_walls)); +// player->undo_move_y(entity_move_check_y(player, room->walls, 2, 10, room->valid_walls)); +// // Bullets +// for (int i = 0; i < bullets_max; i++) { +// for (int j = 0; j < 2; j++) { +// if ((player->valid_bullets[i]) && (room->valid_walls[j]) && (entity_collision(*player->bullets_array[i], *room->walls[j]))) { +// delete player->bullets_array[i]; player->valid_bullets[i] = false; +// } +// } +// } } void RoomEngine::move()