Skip to content

Commit

Permalink
make easy mode easier
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbowman committed May 29, 2021
1 parent ebbdc72 commit fd22e86
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 62 deletions.
Binary file modified images/charset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/old_poster_chinese.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/seed_packet_chinese.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions source/blind_jump/entity/bosses/gatekeeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ScattershotAttackPattern : public GatekeeperShield::AttackPattern {
{
switch (game.difficulty()) {
case Settings::Difficulty::easy:
reload_ += milliseconds(550);
reload_ += milliseconds(600);
break;

case Settings::Difficulty::count:
Expand Down Expand Up @@ -51,7 +51,7 @@ class ScattershotAttackPattern : public GatekeeperShield::AttackPattern {
shot_count_ = 0;
switch (game.difficulty()) {
case Settings::Difficulty::easy:
reload_ = milliseconds(1800);
reload_ = milliseconds(1900);
break;

case Settings::Difficulty::count:
Expand Down Expand Up @@ -105,7 +105,7 @@ class SweepAttackPattern : public GatekeeperShield::AttackPattern {
const auto interval = [&] {
switch (game.difficulty()) {
case Settings::Difficulty::easy:
return 30;
return 35;

case Settings::Difficulty::count:
case Settings::Difficulty::normal:
Expand Down Expand Up @@ -217,7 +217,11 @@ void Gatekeeper::update(Platform& pfrm, Game& game, Microseconds dt)
Enemy::update(pfrm, game, dt);

static constexpr const Microseconds jump_duration = milliseconds(500);
static constexpr const Float movement_rate = 0.000033f;

Float movement_rate = 0.000033f;
if (game.difficulty() == Settings::Difficulty::easy) {
movement_rate = 0.000026f;
}

charge_timer_ += dt;

Expand Down
10 changes: 6 additions & 4 deletions source/blind_jump/entity/bosses/theTwins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void Twin::Helper::update(Platform& pf,
case Helper::State::recharge:
if (timer_ > [&] {
if (game.difficulty() == Settings::Difficulty::easy) {
return seconds(2);
return seconds(2) + milliseconds(250);
} else {
return seconds(1) + milliseconds(500);
}
Expand Down Expand Up @@ -204,7 +204,7 @@ void Twin::update(Platform& pf, Game& game, Microseconds dt)
if (second_form()) {
switch (game.difficulty()) {
case Settings::Difficulty::easy:
return 0.000037f;
return 0.000035f;

case Settings::Difficulty::count:
case Settings::Difficulty::normal:
Expand All @@ -218,7 +218,7 @@ void Twin::update(Platform& pf, Game& game, Microseconds dt)
} else {
switch (game.difficulty()) {
case Settings::Difficulty::easy:
return 0.0000325f;
return 0.0000305f;

case Settings::Difficulty::count:
case Settings::Difficulty::normal:
Expand All @@ -235,7 +235,7 @@ void Twin::update(Platform& pf, Game& game, Microseconds dt)
const Float mode2_move_rate = [&] {
switch (game.difficulty()) {
case Settings::Difficulty::easy:
return 0.0000415f;
return 0.0000405f;

case Settings::Difficulty::count:
case Settings::Difficulty::normal:
Expand Down Expand Up @@ -362,6 +362,8 @@ void Twin::update(Platform& pf, Game& game, Microseconds dt)

if (alt_timer_ > [&] {
if (game.difficulty() == Settings::Difficulty::easy) {
return milliseconds(800);
} else if (game.difficulty() == Settings::Difficulty::normal) {
return milliseconds(640);
} else {
return milliseconds(520);
Expand Down
94 changes: 67 additions & 27 deletions source/blind_jump/entity/bosses/wanderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ static const char* boss_music = "omega";
static const Entity::Health initial_health = 100;


static Entity::Health get_initial_health(Game& game)
{
if (game.difficulty() == Settings::Difficulty::easy) {
return 70;
} else {
return 100;
}
}


Wanderer::Wanderer(const Vec2<Float>& position)
: Enemy(initial_health, position, {{16, 38}, {8, 24}}), timer_(0),
timer2_(0), chase_player_(0), dashes_remaining_(0), bullet_spread_gap_(0)
Expand All @@ -35,15 +45,9 @@ Wanderer::Wanderer(const Vec2<Float>& position)
}


bool Wanderer::second_form() const
{
return get_health() < 58;
}


bool Wanderer::third_form() const
bool Wanderer::second_form(Game& game) const
{
return get_health() < 20;
return get_health() < get_initial_health(game) - 42;
}


Expand Down Expand Up @@ -93,8 +97,8 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)
};

const auto dash_duration =
second_form() ? milliseconds(500) : milliseconds(650);
const float movement_rate = second_form() ? 0.000029f : 0.000022f;
second_form(game) ? milliseconds(500) : milliseconds(650);
const float movement_rate = second_form(game) ? 0.000029f : 0.000022f;

constexpr Angle scattershot_inflection = 90;

Expand All @@ -117,10 +121,15 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)
state_ = State::still;
timer_ = 0;

set_health(get_initial_health(game));

pf.speaker().play_music(boss_music, 0);

show_boss_health(
pf, game, 0, Float(get_health()) / initial_health);
show_boss_health(pf,
game,
0,
Float(get_health()) /
get_initial_health(game));
}
}
break;
Expand Down Expand Up @@ -163,7 +172,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)

} else {
state_ = State::prep_dash;
if (second_form()) {
if (second_form(game)) {
if (rng::choice<3>(rng::critical_state) == 0) {
chase_player_ = 3;
}
Expand Down Expand Up @@ -191,7 +200,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)

if (distance(position_, target.get_position()) > 80 and
rng::choice<2>(rng::critical_state) and
get_health() < initial_health - 10) {
get_health() < get_initial_health(game) - 10) {
state_ = State::big_laser_shooting;
sprite_.set_mix({ColorConstant::electric_blue, 0});
head_.set_mix({ColorConstant::electric_blue, 0});
Expand Down Expand Up @@ -229,7 +238,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)
if (timer_ > [&] {
switch (game.difficulty()) {
case Settings::Difficulty::easy:
if (second_form()) {
if (second_form(game)) {
return milliseconds(100);
} else {
return milliseconds(130);
Expand All @@ -238,7 +247,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)

case Settings::Difficulty::count:
case Settings::Difficulty::normal:
if (second_form()) {
if (second_form(game)) {
return milliseconds(82);
} else {
return milliseconds(90);
Expand All @@ -247,7 +256,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)

case Settings::Difficulty::survival:
case Settings::Difficulty::hard:
if (second_form()) {
if (second_form(game)) {
return milliseconds(66);
} else {
return milliseconds(70);
Expand Down Expand Up @@ -291,7 +300,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)
}
break;

case State::big_laser1:
case State::big_laser1: {
face_player();

timer_ += dt;
Expand All @@ -313,28 +322,54 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)
game.rumble(pf, milliseconds(100));
medium_explosion(pf, game, position_ + shoot_offset());

Float speed = 0.00028f;
if (game.difficulty() == Settings::Difficulty::easy) {
speed = 0.000215f;
}

game.effects().spawn<WandererBigLaser>(
position_ + shoot_offset(),
rng::sample<8>(target.get_position(), rng::critical_state),
0.00028f);
speed);

timer_ = 0;
state_ = State::big_laser2;
}
break;
}

case State::big_laser2:
case State::big_laser2: {
face_player();

Float speed = 0.00021f;
if (game.difficulty() == Settings::Difficulty::easy) {
speed = 0.00016f;
}

const auto wait_time = [&]() {
if (game.difficulty() == Settings::Difficulty::easy) {
return milliseconds(240);
} else {
return milliseconds(180);
}
}();

timer_ += dt;
if (timer_ > milliseconds(180)) {
if (timer_ > wait_time) {
game.effects().spawn<WandererBigLaser>(
position_ + shoot_offset(),
rng::sample<12>(target.get_position(), rng::critical_state),
0.00021f);
speed);
timer_ = 0;
state_ = State::big_laser3;

if (game.difficulty() == Settings::Difficulty::easy) {
state_ = State::done_shooting;
} else {
state_ = State::big_laser3;
}
}
break;
}

case State::final_form:
break;
Expand Down Expand Up @@ -428,7 +463,7 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)
(float(sine(dir)) / INT16_MAX)};
speed_ = 5.f * unit;

if ((not second_form() and
if ((not second_form(game) and
rng::choice<3>(rng::critical_state) == 0) or
(chase_player_ and chase)) {
if (chase_player_) {
Expand Down Expand Up @@ -510,7 +545,11 @@ void Wanderer::update(Platform& pf, Game& game, Microseconds dt)

void Wanderer::injured(Platform& pf, Game& game, Health amount)
{
const bool was_second_form = second_form();
if (state_ == State::sleep) {
return;
}

const bool was_second_form = second_form(game);

if (sprite_.get_mix().amount_ < 180) {
pf.sleep(2);
Expand All @@ -524,7 +563,7 @@ void Wanderer::injured(Platform& pf, Game& game, Health amount)
pf.speaker().play_sound("click", 1, position_);
}

if (not was_second_form and second_form()) {
if (not was_second_form and second_form(game)) {
game.camera().shake();

medium_explosion(pf, game, position_);
Expand All @@ -539,7 +578,8 @@ void Wanderer::injured(Platform& pf, Game& game, Health amount)
head_.set_mix({c, 255});
}

show_boss_health(pf, game, 0, Float(get_health()) / initial_health);
show_boss_health(
pf, game, 0, Float(get_health()) / get_initial_health(game));
}


Expand Down
3 changes: 1 addition & 2 deletions source/blind_jump/entity/bosses/wanderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class Wanderer : public Enemy {
final_form
} state_ = State::sleep;

bool second_form() const;
bool third_form() const;
bool second_form(Game& game) const;

Sprite head_;
Microseconds timer_;
Expand Down
24 changes: 21 additions & 3 deletions source/blind_jump/entity/enemies/dasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static Float shot_speed(Game& game)
{
switch (game.difficulty()) {
case Settings::Difficulty::easy:
return 0.000122f;
return 0.000112f;

case Settings::Difficulty::count:
case Settings::Difficulty::normal:
Expand Down Expand Up @@ -154,7 +154,17 @@ void Dasher::update(Platform& pf, Game& game, Microseconds dt)
case State::shot1:
if (timer_ > milliseconds(50)) {
timer_ -= milliseconds(50);
state_ = State::shot2;

if (game.difficulty() == Settings::Difficulty::easy and
game.level() <= boss_0_level) {
state_ = State::pause;
} else {
if (game.difficulty() == Settings::Difficulty::easy) {
// Space out the attacks a bit more in easy mode.
timer_ = 50;
}
state_ = State::shot2;
}

pf.speaker().play_sound("laser1", 4, position_);
this->shoot(
Expand All @@ -170,7 +180,15 @@ void Dasher::update(Platform& pf, Game& game, Microseconds dt)
const auto t = milliseconds(game.level() > boss_0_level ? 150 : 230);
if (timer_ > t) {
timer_ -= t;
if (game.level() > boss_0_level) {

if (game.difficulty() == Settings::Difficulty::easy and
game.level() <= boss_1_level) {
state_ = State::pause;
} else if (game.level() > boss_0_level) {
if (game.difficulty() == Settings::Difficulty::easy) {
// Space out the attacks a bit more in easy mode.
timer_ = 50;
}
state_ = State::shot3;
} else {
state_ = State::pause;
Expand Down
2 changes: 1 addition & 1 deletion source/blind_jump/entity/enemies/drone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void Drone::update(Platform& pfrm, Game& game, Microseconds dt)
step_vector_ = direction(position_, player_pos) *
(game.difficulty() not_eq Settings::Difficulty::easy
? 0.00015f
: 0.000128f);
: 0.000118f);
}
break;

Expand Down
2 changes: 1 addition & 1 deletion source/blind_jump/entity/enemies/golem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void Golem::update(Platform& pfrm, Game& game, Microseconds dt)
const auto max_count = [&] {
switch (game.difficulty()) {
case Settings::Difficulty::easy:
shot_speed = 0.00016f;
shot_speed = 0.00014f;
return 3;

case Settings::Difficulty::count:
Expand Down
Loading

0 comments on commit fd22e86

Please sign in to comment.