Skip to content

Commit

Permalink
Boss does not Spawn spontanously, changed boss behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
t3m1X committed Jun 4, 2017
1 parent 8a76c55 commit 6c61a3a
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Enemy_Bomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Enemy_Bomb::Enemy_Bomb(int x, int y) : Enemy(x, y)
animation_hurt.SetUp(0, 181, 44, 68, 4, 4, "3,0,3,0,3");
shadow.SetUp(176, 215, 22, 35, 1, 1, "0");

path.PushBack({ 0,0 }, 50, &walk);
path.PushBack({ 0, 0.5f }, 415, &walk);
path.LoopStart(50);
/*path.PushBack({ 0,-1.5f }, 300, &walk);*/

collider_offset.x = 7;
Expand Down
4 changes: 2 additions & 2 deletions Enemy_BonusAirship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ Enemy_BonusAirship::Enemy_BonusAirship(int x, int y) : Enemy(x, y)
fdirection3.Normalize();



path.PushBack({ 0,0 }, 50, &fly);
path.PushBack(fdirection *2, 20, &fly); // Arrives
path.PushBack({ 0, - SCROLL_SPEED }, 30, &fly); //Stays for some time
path.PushBack(fdirection2 * SCROLL_SPEED / 2, 80, &fly);//goes right
path.PushBack(fdirection3 * SCROLL_SPEED / 2, 80, &fly);//goes left
path.LoopStart(20);
path.LoopStart(70);

collider_offset.x = 32;
collider_offset.y = 33;
Expand Down
14 changes: 8 additions & 6 deletions Enemy_Boss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ Enemy_Boss::Enemy_Boss(int x, int y, int subtype) : Enemy(x, y)
turret_shooting.speed = 0.2f;
turret_shooting.loop = false;

path.PushBack({ 0,-1 }, 500, &walk);
path.PushBack({ 0,0 }, 250, &walk);
path.PushBack({ 0,-1 }, 395, &walk);
path.PushBack({ 0,0 }, 100, &walk);
path.LoopStart(500);
path.LoopStart(645);

hitpoints = 10;

Expand All @@ -58,12 +59,13 @@ Enemy_Boss::Enemy_Boss(int x, int y, int subtype) : Enemy(x, y)
turret_shooting.speed = 0.2f;
turret_shooting.loop = false;

path.PushBack({ 1,0 }, 115, &walk);
path.PushBack({ -1,0 }, 115, &walk);
path.PushBack({ 0,0 }, 100, &walk);
path.PushBack({ -1,0 }, 115, &walk);
path.PushBack({ 1,0 }, 115, &walk);
path.PushBack({ 1,0 }, 225, &walk);
path.PushBack({ 0,0 }, 100, &walk);
path.PushBack({ -1,0 }, 450, &walk);
path.PushBack({ 0,0 }, 100, &walk);
path.PushBack({ 1,0 }, 225, &walk);
path.loop = true;

hitpoints = 20;

Expand Down
2 changes: 1 addition & 1 deletion Enemy_Kamikaze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Enemy_Kamikaze::Enemy_Kamikaze(int x, int y) : Enemy(x, y)
animation_hurt.SetUp(375, 0, 146, 108, 4, 4, "3,4,3,4,3");



path.PushBack({ 0,0 }, 50, &fly);
path.PushBack({ 0,1 }, 200, &fly);

if(position.x > SCREEN_WIDTH / 2) // if kamikaze spawsn left of the window goes right, and biceversa
Expand Down
2 changes: 2 additions & 0 deletions Enemy_LightAirship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ Enemy_LightAirship::Enemy_LightAirship(int x, int y) : Enemy(x, y)
fPoint fdirection = { (float)direction.x,(float)direction.y };
fdirection.Normalize();

path.PushBack({ 0,0 }, 50, &fly);
path.PushBack(fdirection*3, 45, &fly);
path.PushBack({ 0, -2 }, 40, &fly);
path.loop = false;

collider_offset.x = 8;
collider_offset.y = 25;
Expand Down
3 changes: 2 additions & 1 deletion Enemy_LightTank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Enemy_LightTank::Enemy_LightTank(int x, int y, int subtype) : Enemy(x, y)
animation_shooting.SetUp(0, 67, 34, 44, 3, 3, "0,1,2");
animation_shooting.speed = 0.3f;

path.PushBack({ 0,0 }, 50, &walk);
switch (subtype)
{
case NORMAL:
Expand All @@ -39,7 +40,7 @@ Enemy_LightTank::Enemy_LightTank(int x, int y, int subtype) : Enemy(x, y)
break;
}


path.LoopStart(50);


collider = App->collision->AddCollider({ 0, 67, 25, 35 }, COLLIDER_TYPE::COLLIDER_ENEMY_GROUND, (Module*)App->enemies);
Expand Down
7 changes: 4 additions & 3 deletions Enemy_MoonAirship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Enemy_MoonAirship::Enemy_MoonAirship(int x, int y) : Enemy(x, y)

animation_hurt.SetUp(629, 465, 98, 89, 4, 4, "2,3,2,3,2");


path.PushBack({ 0,0 }, 50, &fly);

if (position.x > SCREEN_WIDTH / 2)
{
path.PushBack({ 0, 0.5f }, 120, &fly);
Expand All @@ -31,7 +32,7 @@ Enemy_MoonAirship::Enemy_MoonAirship(int x, int y) : Enemy(x, y)
path.PushBack({ 1,1 }, 50, &fly);
path.PushBack({ 1,-2 }, 90, &fly);
path.PushBack({ 0,-0.5 }, 40, &fly);
path.LoopStart(150);
path.LoopStart(200);
}
else
{
Expand All @@ -43,7 +44,7 @@ Enemy_MoonAirship::Enemy_MoonAirship(int x, int y) : Enemy(x, y)
path.PushBack({ -1,1 }, 50, &fly);
path.PushBack({ -1,-2 }, 90, &fly);
path.PushBack({ 0,-0.5 }, 40, &fly);
path.LoopStart(150);
path.LoopStart(200);
}

collider_offset.x = 8;
Expand Down
2 changes: 2 additions & 0 deletions Enemy_RotatoryTank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Enemy_RotatoryTank::Enemy_RotatoryTank(int x, int y) : Enemy(x, y)

animation_hurt.SetUp(629, 635, 94, 93, 4, 4, "2,3,2,3,2");

path.PushBack({ 0,0 }, 50, &walk);

if (position.x > SCREEN_WIDTH / 2)
{
path.PushBack({ 0,0 }, 100, &walk);
Expand Down
2 changes: 1 addition & 1 deletion ModuleEnemies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "Enemy_Boss.h"
#include "Enemy_RotatoryTank.h"

#define SPAWN_MARGIN 200
#define SPAWN_MARGIN 300

ModuleEnemies::ModuleEnemies()
{
Expand Down
2 changes: 1 addition & 1 deletion ModuleStage1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ bool ModuleStage1::Start() {
App->enemies->AddEnemy(ENEMY_TYPES::MOONAIRSHIP, 520, 2290);

App->enemies->AddEnemy(ENEMY_TYPES::BOSS, 290, 545);
App->enemies->AddEnemy(ENEMY_TYPES::BOSS_2, 515, -14);
App->enemies->AddEnemy(ENEMY_TYPES::BOSS_2, 290, -14);

return ret;
}
Expand Down

0 comments on commit 6c61a3a

Please sign in to comment.