Started implementing behaviors

main
BraydonKains 6 years ago
parent 95f5f72df9
commit 2d8714ed26

@ -135,7 +135,6 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="behavior_manager.h" />
<ClInclude Include="bullet.h" /> <ClInclude Include="bullet.h" />
<ClInclude Include="cursor.h" /> <ClInclude Include="cursor.h" />
<ClInclude Include="enums.h" /> <ClInclude Include="enums.h" />

@ -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="behavior_manager.h">
<Filter>Header Files\Engine</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="main.cpp"> <ClCompile Include="main.cpp">
@ -90,7 +87,7 @@
<Filter>Source Files\Assignment3Implement</Filter> <Filter>Source Files\Assignment3Implement</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="object_manager.cpp"> <ClCompile Include="object_manager.cpp">
<Filter>Source Files</Filter> <Filter>Source Files\EngineImplement</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -19,4 +19,9 @@ enum Direction {
UL, UL,
DR, DR,
DL DL
};
enum Behavior {
Player,
Enemy
}; };

@ -1,10 +1,19 @@
#include "ship.h" #include "ship.h"
Ship::Ship() { Ship::Ship(Behavior _behavior) {
speed = 1.0; switch (_behavior) {
height = 40; case Player:
width = 40; speed = 1.0;
height = 40;
width = 40;
break;
case Enemy:
speed = 1.2;
height = 40;
width = 40;
break;
}
l_bound = 50; l_bound = 50;
r_bound = 590; r_bound = 590;
r_bound -= width; r_bound -= width;

@ -13,7 +13,9 @@ public:
float l_bound; float l_bound;
float r_bound; float r_bound;
Ship(); Behavior behavior;
Ship(Behavior _behavior);
void reset_pos(float x, float y); void reset_pos(float x, float y);
void set_sprite(ALLEGRO_BITMAP* _sprite); void set_sprite(ALLEGRO_BITMAP* _sprite);

Loading…
Cancel
Save