Airflower is meant to be a powerup geared to speed runs and sky levels. It makes Tux light on his feet, with a passive ability of faster max run speed and greater attainable jump height.
In addition, airflower has an active ability which allows Tux to glide for a short period of time after jumping. The duration that Tux can glide increases with additional airflower powerups. To glide, the user only needs to hold the jump key while falling. Every time the player jumps they may glide for a set amount of time which is reset upon Tux touching the ground.
Tux sprites still need to be done, and it may be worth considering replacing the backflip with a launching jump when Tux has this powerup. Of course tweaks to the values used will also likely be needed.
menus reworked
addon manager improved
new tilemap- halloween
+new powerups: air- and earth-flower
Supertux Release 0.3.4 (2013-07)
--------------------------------
;; src/tile.cpp, unisolid is 3 not 2
(supertux-tiles
(tile
+ (id 3162)
+ (images
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-4.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ )
+ (solid #t)
+ (fullbox #t)
+ (next-tile 84)
+ (editor-images "objects/bonus_block/bonus-earth_flower.png")
+ (data 14)
+ (fps 15)
+ )
+
+ (tile
+ (id 3161)
+ (images
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-4.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ )
+ (solid #t)
+ (fullbox #t)
+ (next-tile 84)
+ (editor-images "objects/bonus_block/bonus-air_flower.png")
+ (data 13)
+ (fps 15)
+ )
+
+ (tile
(id 3037)
(images
"objects/bonus_block/full-0.png"
)
(tilegroup
(name "Block")
- (tiles 27 28 29 47 48 50 49 211 77 51 52 212 78 62 61 213 3159 44 83 2947 2948 84 102 140 103 104 105 3160 112 128 3037 2943 2944 2945 2946 1311 2153)
+ (tiles 27 28 29 47 48 50 49 211 77 51 52 212 78 62 61 213 3159 44 83 2947 2948 84 103 128 102 140 3161 3162 104 105 3160 112 3037 2943 2944 2945 2946 1311 2153)
)
(tilegroup
(name "Background")
)
(image "tiles/halloween/black.png")
)
-;; next-id: 3161
+;; next-id: 3163
)
namespace {
static const float BUTTJUMP_MIN_VELOCITY_Y = 400.0f;
static const float SHOOTING_TIME = .150f;
+static const float GLIDE_TIME_PER_FLOWER = 0.5f;
/** number of idle stages, including standing */
static const unsigned int IDLE_STAGE_COUNT = 5;
static const float MAX_CLIMB_XM = 96;
/** maximum vertical climb velocity */
static const float MAX_CLIMB_YM = 128;
+/** maximum vertical glide velocity */
+static const float MAX_GLIDE_YM = 128;
/** instant velocity when tux starts to walk */
static const float WALK_SPEED = 100;
backflip_direction(),
peekingX(),
peekingY(),
+ glide_time(),
+ stone(),
swimming(),
speedlimit(),
scripting_controller_old(0),
safe_timer(),
kick_timer(),
shooting_timer(),
+ ability_timer(),
+ cooldown_timer(),
dying_timer(),
growing(),
backflip_timer(),
backflip_direction = 0;
sprite->set_angle(0.0f);
visible = true;
+ glide_time = 0;
+ stone = false;
swimming = false;
on_ice = false;
ice_this_frame = false;
if (deactivated)
do_standup();
}
+ if (player_status->bonus == AIR_BONUS)
+ glide_time = player_status->max_air_time * GLIDE_TIME_PER_FLOWER;
}
// calculate movement for this frame
else
do_jump((fabs(physic.get_velocity_x()) > MAX_WALK_XM) ? -580 : -520);
}
- }
+ // airflower glide only when holding jump key
+ } else if (controller->hold(Controller::JUMP) && player_status->bonus == AIR_BONUS && physic.get_velocity_y() > MAX_GLIDE_YM) {
+ if (glide_time > 0 && !ability_timer.started())
+ ability_timer.start(glide_time);
+ else if (ability_timer.started()) {
+ log_debug << ability_timer.get_timeleft() << std::endl;
+ if (ability_timer.get_timeleft() <= 0.05f) {
+ glide_time = 0;
+ ability_timer.stop();
+ } else {
+ physic.set_velocity_y(MAX_GLIDE_YM);
+ physic.set_acceleration_y(0);
+ }
+ }
+ }
+ /*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) {
jumping = false;
early_jump_apex();
}
+ if (player_status->bonus == AIR_BONUS && ability_timer.started()){
+ glide_time = ability_timer.get_timeleft();
+ ability_timer.stop();
+ }
}
if(jump_early_apex && physic.get_velocity_y() >= 0) {
int backflip_direction;
Direction peekingX;
Direction peekingY;
+ float glide_time;
+ bool stone;
bool swimming;
float speedlimit;
Controller* scripting_controller_old; /**< Saves the old controller while the scripting_controller is used */
Timer safe_timer;
Timer kick_timer;
Timer shooting_timer; // used to show the arm when Tux is shooting
+ Timer ability_timer; // maximum lengh of time that special abilities can last
+ Timer cooldown_timer; // minimum time period between successive uses of a special ability
Timer dying_timer;
bool growing;
Timer backflip_timer;
BonusType bonus;
int max_fire_bullets; /**< maximum number of fire bullets in play */
int max_ice_bullets; /**< maximum number of ice bullets in play */
- int max_air_time; /**< maximum number of seconds player can float in air */
- int max_earth_time; /**< maximum number of seconds player can turn to stone */
+ int max_air_time; /**<determines maximum number of seconds player can float in air */
+ int max_earth_time; /**< determines maximum number of seconds player can turn to stone */
private:
int displayed_coins;
case ICE_BONUS:
sprite->set_action(moving ? "ice-walking" : "ice-stop");
break;
+ case AIR_BONUS:
+ sprite->set_action(moving ? "ice-walking" : "ice-stop");
+ break;
+ case EARTH_BONUS:
+ sprite->set_action(moving ? "fire-walking" : "fire-stop");
+ break;
case NO_BONUS:
sprite->set_action(moving ? "small-walking" : "small-stop");
break;