To activate stone form, press DOWN while holding the ACTION key. Player does not take damage while in stone form, and ability can be use offensively to crush enemies- including those that cannot be squished.
Still needs timers set up to limit the ability, and a ton of sprite work.
// hit from above?
if (player->get_bbox().p2.y < (bbox.p1.y + 16)) {
// hit from above?
if (player->get_bbox().p2.y < (bbox.p1.y + 16)) {
+ if(player->is_stone()) {
+ kill_fall();
+ return FORCE_MOVE;
+ }
if(collision_squished(*player)) {
return FORCE_MOVE;
}
}
if(collision_squished(*player)) {
return FORCE_MOVE;
}
}
+ if(player->is_stone()) {
+ collision_solid(hit);
+ return FORCE_MOVE;
+ }
+
return collision_player(*player, hit);
}
return collision_player(*player, hit);
}
- /*ability_timer.started() ? gliding = true : ability_timer.start(player_status->max_air_time);*/
- //}
// Let go of jump key
else if(!controller->hold(Controller::JUMP)) {
if (!backflipping && jumping && physic.get_velocity_y() < 0) {
// Let go of jump key
else if(!controller->hold(Controller::JUMP)) {
if (!backflipping && jumping && physic.get_velocity_y() < 0) {
}
/* Handle horizontal movement: */
}
/* Handle horizontal movement: */
- if (!backflipping) handle_horizontal_input();
+ if (!backflipping && !stone) handle_horizontal_input();
/* Jump/jumping? */
if (on_ground())
can_jump = true;
/* Handle vertical movement: */
/* Jump/jumping? */
if (on_ground())
can_jump = true;
/* Handle vertical movement: */
- handle_vertical_input();
+ if (!stone) handle_vertical_input();
/* Shoot! */
if (controller->pressed(Controller::ACTION) && (player_status->bonus == FIRE_BONUS || player_status->bonus == ICE_BONUS)) {
/* Shoot! */
if (controller->pressed(Controller::ACTION) && (player_status->bonus == FIRE_BONUS || player_status->bonus == ICE_BONUS)) {
+ /* Turn to Stone */
+ if (controller->pressed(Controller::DOWN) && player_status->bonus == EARTH_BONUS) {
+ if (controller->hold(Controller::ACTION)) {
+ jump_early_apex = false;
+ stone = true;
+ }
+ }
+
+ if (stone)
+ apply_friction();
+
+ /* Revert from Stone */
+ if (stone && !controller->hold(Controller::ACTION))
+ stone = false;
+
- if (controller->hold(Controller::DOWN)) {
+ if (controller->hold(Controller::DOWN) && !stone) {
do_duck();
} else {
do_standup();
do_duck();
} else {
do_standup();
if(badguy != NULL) {
if(safe_timer.started() || invincible_timer.started())
return FORCE_MOVE;
if(badguy != NULL) {
if(safe_timer.started() || invincible_timer.started())
return FORCE_MOVE;
+ if(stone)
+ return ABORT_MOVE;
if(dying || deactivated || is_winning() )
return;
if(dying || deactivated || is_winning() )
return;
- if(!completely && (safe_timer.started() || invincible_timer.started()))
+ if(!completely && (safe_timer.started() || invincible_timer.started() || stone))
bool is_dead() const
{ return dead; }
bool is_big();
bool is_dead() const
{ return dead; }
bool is_big();
+ bool is_stone()
+ { return stone; }
void set_visible(bool visible);
bool get_visible();
void set_visible(bool visible);
bool get_visible();