Skip to content

Commit

Permalink
Player2 ultimate charged fx
Browse files Browse the repository at this point in the history
  • Loading branch information
christt105 committed Jun 3, 2018
1 parent de80c12 commit ae38ef2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
12 changes: 6 additions & 6 deletions SDL_AndroDunos/Enemy_Boss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Enemy_Boss::Enemy_Boss(int x, int y) :Enemy(x, y) {
anim.PushBack({ 0,743,187,89 });
anim.PushBack({ 187,743,187,89 });
//anim.PushBack({ 187,743,187,89 });
anim.speed = 0.8f;
anim.loop = true;

Expand All @@ -31,7 +31,7 @@ Enemy_Boss::Enemy_Boss(int x, int y) :Enemy(x, y) {
original_pos.y = y;
init_time = SDL_GetTicks(); //Timer

life = 10;
life = 50;
}

void Enemy_Boss::Move() {
Expand All @@ -50,15 +50,15 @@ void Enemy_Boss::Move() {


void Enemy_Boss::Dispend() {
for (int i = 0; i < 4; i++)
App->enemies->AddEnemy(BOSS_DISP, position.x, position.y);
/*for (int i = 0; i < 4; i++)
App->enemies->AddEnemy(BOSS_DISP, position.x, position.y);*/

}


void Enemy_Boss::Draw(SDL_Texture* sprites) {
if (collider != nullptr)
collider->SetPos(position.x + 7, position.y + 33);
collider->SetPos(position.x + 7, position.y+15);

App->render->Blit(sprites, position.x, position.y, &(animation->GetCurrentFrame()));
App->render->Blit(sprites, position.x, position.y, &(fire->anim.GetCurrentFrame()));
Expand Down Expand Up @@ -108,7 +108,7 @@ void Fire_Gun::Shoot() {

Enemy_Boss_Destroyed::Enemy_Boss_Destroyed(int x, int y) :Enemy(x, y) {
anim.PushBack({ 0,960,187,60 });
anim.PushBack({ 187,960,187,60 });
//anim.PushBack({ 187,960,187,60 });

collider = App->collision->AddCollider({ 0, 0, 75, 100 }, COLLIDER_TYPE::COLLIDER_ENEMY, (Module*)App->enemies);

Expand Down
5 changes: 4 additions & 1 deletion SDL_AndroDunos/ModulePlayer1.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class ModulePlayer1 : public Module
bool charged = false;
bool hp_down = false;

public:
uint ultimate_charged_fx;

private:

int time_bomb = 0;
Expand All @@ -69,7 +72,7 @@ class ModulePlayer1 : public Module

Collider* player_col = nullptr;

uint fx_laser1, fx_laser2, fx_laser3, fx_laser4, explosion_player, type_change_fx, ultimate_charged_fx, ultimate_charge_fx;
uint fx_laser1, fx_laser2, fx_laser3, fx_laser4, explosion_player, type_change_fx, ultimate_charge_fx;

bool destroyed = false;
bool dead = false;
Expand Down
6 changes: 5 additions & 1 deletion SDL_AndroDunos/ModulePlayer2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ update_status ModulePlayer2::Update()
charge = true;
else charge = false;



if (((App->input->keyboard[SDL_SCANCODE_RCTRL] == KEY_STATE::KEY_UP || App->input->buttons2[SDL_CONTROLLER_BUTTON_A] == KEY_STATE::KEY_UP) && charged && powerup_s>1) || App->input->keyboard[SDL_SCANCODE_F4] == KEY_STATE::KEY_DOWN)
Ultimate();

Expand Down Expand Up @@ -296,8 +298,10 @@ update_status ModulePlayer2::Update()

// Draw everything --------------------------------------
Animation *ship_state = ship;
if (charged)
if (charged) {
ship_state = anim_ultimate;
App->audio->PlayFx(App->player1->ultimate_charged_fx);
}

if (hp > 0) { //Render Ship
if (blink)
Expand Down

0 comments on commit ae38ef2

Please sign in to comment.