Started implementing behaviors

main
BraydonKains 6 years ago
parent 95f5f72df9
commit 2d8714ed26

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

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

@ -20,3 +20,8 @@ enum Direction {
DR,
DL
};
enum Behavior {
Player,
Enemy
};

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

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

Loading…
Cancel
Save