Some changes to something

main
BraydonKains 6 years ago
parent 84527304ae
commit f35c70c86e

@ -146,7 +146,6 @@
<ClInclude Include="game.h" /> <ClInclude Include="game.h" />
<ClInclude Include="game_element.h" /> <ClInclude Include="game_element.h" />
<ClInclude Include="game_screen.h" /> <ClInclude Include="game_screen.h" />
<ClInclude Include="mappy_A5.h" />
<ClInclude Include="object_manager.h" /> <ClInclude Include="object_manager.h" />
<ClInclude Include="screen.h" /> <ClInclude Include="screen.h" />
<ClInclude Include="ship.h" /> <ClInclude Include="ship.h" />
@ -158,7 +157,6 @@
<ClCompile Include="game.cpp" /> <ClCompile Include="game.cpp" />
<ClCompile Include="game_screen.cpp" /> <ClCompile Include="game_screen.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="mappy_A5.c" />
<ClCompile Include="object_manager.cpp" /> <ClCompile Include="object_manager.cpp" />
<ClCompile Include="ship.cpp" /> <ClCompile Include="ship.cpp" />
<ClCompile Include="start_screen.cpp" /> <ClCompile Include="start_screen.cpp" />

@ -63,9 +63,6 @@
<ClInclude Include="object_manager.h"> <ClInclude Include="object_manager.h">
<Filter>Header Files\Engine</Filter> <Filter>Header Files\Engine</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="mappy_A5.h">
<Filter>Header Files\Engine</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="main.cpp"> <ClCompile Include="main.cpp">
@ -92,9 +89,6 @@
<ClCompile Include="object_manager.cpp"> <ClCompile Include="object_manager.cpp">
<Filter>Source Files\EngineImplement</Filter> <Filter>Source Files\EngineImplement</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="mappy_A5.c">
<Filter>Source Files\EngineImplement</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Text Include="enemies.txt"> <Text Include="enemies.txt">

@ -223,23 +223,8 @@ void GameScreen::run(ALLEGRO_FONT* font) {
//Redraw all elements of the screen //Redraw all elements of the screen
void GameScreen::redraw(ALLEGRO_FONT* font) { void GameScreen::redraw(ALLEGRO_FONT* font) {
//MapDrawBG(0, map_y, 0, SCREEN_L_B, SCREEN_W - 80, SCREEN_H); //MapDrawBG(0, map_y, 0, SCREEN_L_B, SCREEN_W - 80, SCREEN_H);
objects.player->draw(); objects.draw_objects();
vector<int> unload;
for (unsigned int i = 0; i < objects.player_bullets.size(); i++) {
if (objects.player_bullets.at(i)->oob) {
unload.push_back(i);
}
else {
objects.player_bullets.at(i)->move(U);
objects.player_bullets.at(i)->draw();
}
}
for (unsigned int i = 0; i < unload.size(); i++) {
int x = unload.at(i);
objects.player_bullets.erase(objects.player_bullets.begin() + x);
}
} }
void GameScreen::back() { void GameScreen::back() {

@ -1,5 +1,7 @@
#include "object_manager.h" #include "object_manager.h"
using std::vector;
ObjectManager::ObjectManager() { ObjectManager::ObjectManager() {
} }
@ -15,3 +17,23 @@ bool ObjectManager::chk_player_col() {
int ObjectManager::chk_bullet_col() { int ObjectManager::chk_bullet_col() {
return 0; return 0;
} }
void ObjectManager::draw_objects()
{
player->draw();
bool unload = false;
for (unsigned int i = 0; i < player_bullets.size(); i++) {
if (player_bullets.at(i)->oob) {
unload = true;
}
else {
player_bullets.at(i)->move(U);
player_bullets.at(i)->draw();
}
}
if (unload) {
player_bullets.pop_back();
}
}

@ -17,4 +17,5 @@ public:
void initiate(Ship* _player); void initiate(Ship* _player);
bool chk_player_col(); bool chk_player_col();
int chk_bullet_col(); int chk_bullet_col();
void draw_objects();
}; };
Loading…
Cancel
Save