Skip to content

Commit

Permalink
New powerups added to worldmap cheat menu
Browse files Browse the repository at this point in the history
  • Loading branch information
LMH0013 committed Nov 15, 2014
1 parent b5fa68a commit a351cbf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/object/player.cpp
Expand Up @@ -132,7 +132,6 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) :
jump_early_apex(),
on_ice(),
ice_this_frame(),
light(1.0f,1.0f,1.0f),
lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light-tiny.sprite")),
dir(),
old_dir(),
Expand Down Expand Up @@ -1229,9 +1228,8 @@ Player::draw(DrawingContext& context)
; // don't draw Tux
else {
sprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
// illuminate Tux in dark areas with earthflower bonus
context.get_light( get_bbox().get_middle(), &light );
if (light.red + light.green + light.blue < 3.0 && player_status->bonus == EARTH_BONUS){
// draw light with earthflower bonus
if (player_status->bonus == EARTH_BONUS){
context.push_target();
context.set_target(DrawingContext::LIGHTMAP);
lightsprite->draw(context, get_pos() + Vector(dir==LEFT ? 0 : 32, 0), 0);
Expand Down
1 change: 0 additions & 1 deletion src/object/player.hpp
Expand Up @@ -282,7 +282,6 @@ class Player : public MovingObject,
bool jump_early_apex;
bool on_ice;
bool ice_this_frame;
Color light;
SpritePtr lightsprite;

public:
Expand Down
10 changes: 10 additions & 0 deletions src/supertux/menu/worldmap_cheat_menu.cpp
Expand Up @@ -31,6 +31,8 @@ WorldmapCheatMenu::WorldmapCheatMenu()
add_entry(MNID_GROW, _("Bonus: Grow"));
add_entry(MNID_FIRE, _("Bonus: Fire"));
add_entry(MNID_ICE, _("Bonus: Ice"));
add_entry(MNID_AIR, _("Bonus: Air"));
add_entry(MNID_EARTH, _("Bonus: Earth"));
add_entry(MNID_SHRINK, _("Bonus: None"));
add_hl();
add_entry(MNID_FINISH_LEVEL, _("Finish Level"));
Expand Down Expand Up @@ -68,6 +70,14 @@ WorldmapCheatMenu::menu_action(MenuItem* item)
status->bonus = ICE_BONUS;
break;

case MNID_AIR:
status->bonus = AIR_BONUS;
break;

case MNID_EARTH:
status->bonus = EARTH_BONUS;
break;

case MNID_SHRINK:
status->bonus = NO_BONUS;
break;
Expand Down
2 changes: 2 additions & 0 deletions src/supertux/menu/worldmap_cheat_menu.hpp
Expand Up @@ -27,6 +27,8 @@ class WorldmapCheatMenu : public Menu
MNID_GROW,
MNID_FIRE,
MNID_ICE,
MNID_AIR,
MNID_EARTH,
MNID_SHRINK,
MNID_FINISH_LEVEL,
MNID_RESET_LEVEL,
Expand Down

0 comments on commit a351cbf

Please sign in to comment.