Skip to content

Commit

Permalink
Added Gamepad Pulsation on Trakt's Super
Browse files Browse the repository at this point in the history
  • Loading branch information
AitorSimona committed May 11, 2019
1 parent 081fdff commit e8b70b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions FantasyBrawl_Project/Motor2D/j1Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ bool j1Player::Start()
superTimer.Start();
shieldTimer.Start();
basicTimer.Start();
Traktpulsation.Start();

return true;
}
Expand Down Expand Up @@ -391,6 +392,23 @@ void j1Player::BlitSuperAimPaths(float dt)
break;
case CHARACTER::TRAKT:
App->view->PushQueue(3, manager->TraktSuper_aimpath, this->Entityinfo.position.x - (int)(240 * Entityinfo.scale), this->Entityinfo.position.y - (int)(250 * Entityinfo.scale), SDL_Rect{ 0,0,350,350 }, ((int)ID) + 1, 0, 0, 0, 0);

// --- All gamepads vibrate on trakt's super (heart pulsation) ---
ComputeDistance2players();

if (Traktpulsation.ReadSec() > 2.0f && superTimer.ReadSec() > 5.0f)
{
Traktpulsation.Start();
if (absoluteDistanceP1 < 265.0f * Entityinfo.scale)
App->input->ShakeController(PLAYER::P1, 0.25, 750);
if (absoluteDistanceP2 < 265.0f * Entityinfo.scale)
App->input->ShakeController(PLAYER::P2, 0.25, 750);
if (absoluteDistanceP3 < 265.0f * Entityinfo.scale)
App->input->ShakeController(PLAYER::P3, 0.25, 750);
if (absoluteDistanceP4 < 265.0f * Entityinfo.scale)
App->input->ShakeController(PLAYER::P4, 0.25, 750);
}

break;
case CHARACTER::MELIADOUL:
if (abs(RJdirection_x) > multipliermin || abs(RJdirection_y) > multipliermin)
Expand Down
1 change: 1 addition & 0 deletions FantasyBrawl_Project/Motor2D/j1Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class j1Player :public j1Entity
j1Timer basicTimer;
j1Timer attackanimTimer;
j1Timer RJinversion;
j1Timer Traktpulsation;
bool shieldON = false;
bool superON = false;

Expand Down

0 comments on commit e8b70b1

Please sign in to comment.