Skip to content

Commit

Permalink
Merge pull request #43 from There-can-only-be-two/LucesDerechaBonusx10
Browse files Browse the repository at this point in the history
Added right arrow light
  • Loading branch information
StarvinXarvin authored Nov 20, 2022
2 parents 52a86f9 + 54246cf commit 5964225
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
39 changes: 36 additions & 3 deletions ModuleLights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ bool ModuleLights::Start()
arrows_mid_B = App->textures->Load("pinball/Lights/arrows_mid_B.png");
combo_A = App->textures->Load("pinball/Lights/combo_A.png");
trigger = App->textures->Load("pinball/Lights/trigger.png");
x10 = App->textures->Load("pinball/Lights/x10.png");
x10 = App->textures->Load("pinball/Lights/x10_2.png");


LoadAnimations();
anim_CurrentArrowsLeft = &anim_ArrowsLeft;
anim_CurrentArrowsMid_A = &anim_ArrowsMid_A;
anim_Currentx10 = &anim_x10;


return true;
Expand All @@ -47,7 +48,7 @@ update_status ModuleLights::Update()
App->scene_intro->sensorTriRight_Sensed = true;

App->scene_intro->sensorTime_Sensed = true;
//App->scene_intro->sensorX10_Sensed = true;
App->scene_intro->sensorX10_Sensed = true;

App->scene_intro->sensorComboA1_Sensed = true;
App->scene_intro->sensorComboA2_Sensed = true;
Expand All @@ -72,6 +73,8 @@ update_status ModuleLights::PostUpdate()
ArrowLeft();
ArrowMid_A();

X10Bonus();

return UPDATE_CONTINUE;
}

Expand Down Expand Up @@ -297,6 +300,26 @@ void ModuleLights::ComboB()
}
}

void ModuleLights::X10Bonus()
{
if (App->scene_intro->sensorX10_Sensed)
delayx10 = 1;

if (delayx10 == 1)
{
anim_Currentx10->Update();

if (anim_Currentx10->GetCurrentFrameint() == 5)
{
delayx10 = 0;
anim_Currentx10->Reset();
}
}

SDL_Rect rectx10 = anim_Currentx10->GetCurrentFrame();
App->renderer->Blit(x10, 353, 442, &rectx10);
}

void ModuleLights::Time()
{
SDL_Rect rect;
Expand Down Expand Up @@ -351,7 +374,7 @@ void ModuleLights::ArrowMid_A()
{
anim_CurrentArrowsMid_A->Update();

if (anim_CurrentArrowsMid_A->GetCurrentFrameint() == 5)
if (anim_CurrentArrowsMid_A->GetCurrentFrameint() == 6)
{
delayArrowsMid_A = 0;
anim_CurrentArrowsMid_A->Reset();
Expand Down Expand Up @@ -419,4 +442,14 @@ void ModuleLights::LoadAnimations()
anim_ArrowsMid_B.PushBack({ 0, 0, 48, 148 });
anim_ArrowsMid_B.speed = 0.2f;
anim_ArrowsMid_B.loop;

//10k Bonus
anim_x10.PushBack({ 0, 0, 99, 90});
anim_x10.PushBack({ 99, 0, 99, 90});
anim_x10.PushBack({ 0, 0, 99, 90 });
anim_x10.PushBack({ 99, 0, 99, 90 });
anim_x10.PushBack({ 0, 0, 99, 90 });
anim_x10.PushBack({ 99, 0, 99, 90 });
anim_x10.speed = 0.1f;
anim_x10.loop = false;
}
5 changes: 5 additions & 0 deletions ModuleLights.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ModuleLights : public Module
void ArrowLeft();
void ArrowMid_A();
void ArrowMid_B();
void X10Bonus();

void LoadAnimations();

Expand All @@ -48,13 +49,17 @@ class ModuleLights : public Module
int delayArrowsLeft;
int delayArrowsMid_A;
int delayArrowsMid_B;
int delayx10;

Animation* anim_CurrentTime = nullptr;
Animation* anim_CurrentArrowsLeft = nullptr;
Animation* anim_CurrentArrowsMid_A = nullptr;
Animation* anim_CurrentArrowsMid_B = nullptr;
Animation* anim_Currentx10 = nullptr;
Animation anim_Time;
Animation anim_ArrowsLeft;
Animation anim_ArrowsMid_A;
Animation anim_ArrowsMid_B;
Animation anim_x10;

};

0 comments on commit 5964225

Please sign in to comment.