Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
enano4k committed Apr 11, 2020
1 parent 4b6b2d0 commit a90ea2a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 129 deletions.
1 change: 1 addition & 0 deletions include/Character/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Player : public Character

//Dash
int dash_last_tap_frame;
int dash_velocity;
int dash_extra_velocity_x, dash_extra_velocity_y;

//Shield
Expand Down
136 changes: 8 additions & 128 deletions src/Character/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ void Player::loadPlayerFromXML()
if (root_node->hasAttribute("velocity"))
this->original_velocity = atoi(root_node->attributes["velocity"].c_str());

this->dash_velocity = 0;
if (root_node->hasAttribute("dash_velocity"))
this->dash_velocity = atoi(root_node->attributes["dash_velocity"].c_str());

if (root_node->hasAttribute("primary_weapon_velocity"))
this->primary_weapon_velocity = atoi(root_node->attributes["primary_weapon_velocity"].c_str());
else
Expand Down Expand Up @@ -271,130 +275,6 @@ void Player::inputControl()
current_velocity = velocity_override;
}

// Double tap
/*
if (up_pressed && !down_pressed && !left_pressed && !right_pressed) //8
{
if(this->frame - this->pressed_8_last_frameX < 10)
{
this->dash_extra_velocity_y = -20;
this->pressed_8_last_frameX = 0;
}else
{
if(this->dash_extra_velocity_y == 0)
{
this->pressed_8_last_frame = true;
}
}
delta_y = -(current_velocity + velocity_boost) / getSlowdown();
}else
{
if(this->pressed_8_last_frame)
{
this->pressed_1_last_frameX = 0;
this->pressed_2_last_frameX = 0;
this->pressed_3_last_frameX = 0;
this->pressed_4_last_frameX = 0;
this->pressed_6_last_frameX = 0;
this->pressed_7_last_frameX = 0;
this->pressed_8_last_frameX = this->frame;
this->pressed_9_last_frameX = 0;
}
this->pressed_8_last_frame = false;
}
if (!up_pressed && down_pressed && !left_pressed && !right_pressed) //2
{
if(this->frame - this->pressed_2_last_frameX < 10)
{
this->dash_extra_velocity_y = 20;
this->pressed_2_last_frameX = 0;
}else
{
if(this->dash_extra_velocity_y == 0)
{
this->pressed_2_last_frame = true;
}
}
delta_y = (current_velocity + velocity_boost) / getSlowdown();
}else
{
if(this->pressed_2_last_frame)
{
this->pressed_1_last_frameX = 0;
this->pressed_2_last_frameX = this->frame;
this->pressed_3_last_frameX = 0;
this->pressed_4_last_frameX = 0;
this->pressed_6_last_frameX = 0;
this->pressed_7_last_frameX = 0;
this->pressed_8_last_frameX = 0;
this->pressed_9_last_frameX = 0;
}
this->pressed_2_last_frame = false;
}
if (!up_pressed && !down_pressed && left_pressed && !right_pressed) //4
{
if(this->frame - this->pressed_4_last_frameX < 10)
{
this->dash_extra_velocity_x = -20;
this->pressed_4_last_frameX = 0;
}else
{
if(this->dash_extra_velocity_y == 0)
{
this->pressed_4_last_frame = true;
}
}
delta_x = -(current_velocity + velocity_boost) / getSlowdown();
}else
{
if(this->pressed_4_last_frame)
{
this->pressed_1_last_frameX = 0;
this->pressed_2_last_frameX = 0;
this->pressed_3_last_frameX = 0;
this->pressed_4_last_frameX = this->frame;
this->pressed_6_last_frameX = 0;
this->pressed_7_last_frameX = 0;
this->pressed_8_last_frameX = 0;
this->pressed_9_last_frameX = 0;
}
this->pressed_4_last_frame = false;
}
if (!up_pressed && !down_pressed && !left_pressed && right_pressed) //6
{
if(this->frame - this->pressed_6_last_frameX < 10)
{
this->dash_extra_velocity_x = 20;
this->pressed_6_last_frameX = 0;
}else
{
if(this->dash_extra_velocity_y == 0)
{
this->pressed_6_last_frame = true;
}
}
delta_x = (current_velocity + velocity_boost) / getSlowdown();
}else
{
if(this->pressed_6_last_frame)
{
this->pressed_1_last_frameX = 0;
this->pressed_2_last_frameX = 0;
this->pressed_3_last_frameX = 0;
this->pressed_4_last_frameX = 0;
this->pressed_6_last_frameX = this->frame;
this->pressed_7_last_frameX = 0;
this->pressed_8_last_frameX = 0;
this->pressed_9_last_frameX = 0;
}
this->pressed_6_last_frame = false;
}
*/

if (up_pressed && !down_pressed && !left_pressed && !right_pressed) //8
{
delta_y = -(current_velocity + velocity_boost) / getSlowdown();
Expand Down Expand Up @@ -466,28 +346,28 @@ void Player::inputControl()
&& this->current_state != "dash right"
&& this->hasState("dash right"))
{
dash_extra_velocity_x = 20;
dash_extra_velocity_x = dash_velocity;
this->setState("dash right");
}
if(dash_pressed && isDownWrapper("4")
&& this->current_state != "dash left"
&& this->hasState("dash left"))
{
dash_extra_velocity_x = -20;
dash_extra_velocity_x = -dash_velocity;
this->setState("dash left");
}
if(dash_pressed && isDownWrapper("2")
&& this->current_state != "dash down"
&& this->hasState("dash down"))
{
dash_extra_velocity_y = 20;
dash_extra_velocity_y = dash_velocity;
this->setState("dash down");
}
if(dash_pressed && isDownWrapper("8")
&& this->current_state != "dash up"
&& this->hasState("dash up"))
{
dash_extra_velocity_y = -20;
dash_extra_velocity_y = -dash_velocity;
this->setState("dash up");
}

Expand Down
1 change: 1 addition & 0 deletions src/Menus/Intro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void intro()

frames = 0;

rosalila()->sound->playMusic(std::string(assets_directory) + "intro.ogg", -1);
while (true)
{
// auto skip
Expand Down
3 changes: 2 additions & 1 deletion src/Menus/StageSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ void stageSelect()
player->enemy = enemy;
stage->loadFromXML(stage_names[current_stage], false);
rosalila()->api_integrator->setCurrentControllerActionSet("InGameControls");
updateMusic(current_stage);
STG *stg = new STG(player, enemy, stage, game_mode, current_player_best_score);

if (getIsFirstWin())
Expand Down Expand Up @@ -691,7 +692,7 @@ void stageSelect()
if (background_color.blue > target_color.blue)
background_color.blue--;

updateMusic(current_stage);
//updateMusic(current_stage);

rosalila()->graphics->drawImage(background, 0, 0);

Expand Down

0 comments on commit a90ea2a

Please sign in to comment.