Skip to content

Commit

Permalink
Easter Egg: Add Santa head to tux during christmas
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Mar 27, 2015
1 parent 25aacba commit 9762ee8
Show file tree
Hide file tree
Showing 16 changed files with 307 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/fire/santa_cap/duck.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 added data/images/creatures/tux/fire/santa_cap/skid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions data/images/creatures/tux/powerups.sprite
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,114 @@
(name "earth-buttjump-left")
(hitbox 16 14 32 64)
(mirror-action "earth-buttjump-right"))


; Santa Tux
(action
(name "santa-walk-right")
(fps 15)
(hitbox 15 14 32 64)
(images "fire/santa_cap/walk-0.png"
"fire/santa_cap/walk-1.png"
"fire/santa_cap/stand.png"
"fire/santa_cap/walk-0.png"
"fire/santa_cap/walk-1.png"
"fire/santa_cap/stand.png"))

(action
(name "santa-walk-left")
(fps 15)
(hitbox 17 14 32 64)
(mirror-action "santa-walk-right"))

(action
(name "santa-stand-right")
(hitbox 16 14 32 64)
(images "fire/santa_cap/stand.png"))

(action
(name "santa-stand-left")
(hitbox 16 14 32 64)
(mirror-action "santa-stand-right"))

(action
(name "santa-jump-right")
(hitbox 16 14 32 64)
(images "fire/santa_cap/stand.png"))

(action
(name "santa-jump-left")
(hitbox 16 14 32 64)
(mirror-action "santa-jump-right"))

(action
(name "santa-skid-right")
(hitbox 16 14 32 64)
(images "fire/santa_cap/skid.png"))

(action
(name "santa-skid-left")
(hitbox 16 14 32 64)
(mirror-action "santa-skid-right"))

(action
(name "santa-kick-right")
(hitbox 16 14 32 64)
(images "fire/santa_cap/stand.png"))

(action
(name "santa-kick-left")
(hitbox 16 14 32 64)
(mirror-action "santa-kick-right"))

(action
(name "santa-idle-right")
(hitbox 16 14 32 64)
(images "fire/santa_cap/stand.png"))

(action
(name "santa-idle-left")
(hitbox 16 14 32 64)
(mirror-action "santa-idle-right"))

(action
(name "santa-climbing-right")
(hitbox 22 21 32 64)
(images "fire/santa_cap/stand.png"))

(action
(name "santa-climbing-left")
(hitbox 22 21 32 64)
(mirror-action "santa-climbing-right"))

(action
(name "santa-duck-right")
(hitbox 16 45 32 32)
(images "fire/santa_cap/duck.png"))

(action
(name "santa-duck-left")
(hitbox 16 45 32 32)
(mirror-action "santa-duck-right"))

(action
(name "santa-backflip-right")
(hitbox 16 37 32 32)
(images "fire/santa_cap/backflip.png"))

(action
(name "santa-backflip-left")
(hitbox 16 37 32 32)
(mirror-action "santa-backflip-right"))

(action
(name "santa-buttjump-right")
(hitbox 16 14 32 64)
(images "fire/santa_cap/stand.png"))

(action
(name "santa-buttjump-left")
(hitbox 16 14 32 64)
(mirror-action "santa-buttjump-right"))

)
121 changes: 121 additions & 0 deletions data/images/creatures/tux/tux.sprite
Original file line number Diff line number Diff line change
Expand Up @@ -838,5 +838,126 @@
(name "earth-buttjump-left-stone")
(hitbox 16 14 32 64)
(mirror-action "earth-buttjump-right-stone"))

; Santa Tux
(action
(name "santa-walk-right")
(fps 15.0)
(hitbox 16 14 32 64)
(images "big/walk-0.png"
"big/walk-1.png"
"big/walk-2.png"
"big/walk-3.png"
"big/walk-4.png"
"big/walk-5.png"))

(action
(name "santa-walk-left")
(fps 15.0)
(hitbox 16 14 32 64)
(mirror-action "santa-walk-right"))

(action
(name "santa-stand-right")
(fps 15.0)
(hitbox 16 14 32 64)
(images "big/stand-0.png"))

(action
(name "santa-stand-left")
(fps 15.0)
(hitbox 16 14 32 64)
(mirror-action "santa-stand-right"))

(action
(name "santa-jump-right")
(fps 15.0)
(hitbox 16 14 32 64)
(images "big/jump-0.png"))

(action
(name "santa-jump-left")
(fps 15.0)
(hitbox 16 14 32 64)
(mirror-action "santa-jump-right"))

(action
(name "santa-skid-right")
(hitbox 16 14 32 64)
(images "big/skid-0.png"))

(action
(name "santa-skid-left")
(hitbox 16 14 32 64)
(mirror-action "santa-skid-right"))

(action
(name "santa-kick-right")
(hitbox 16 14 32 64)
(images "big/kick-0.png"))

(action
(name "santa-kick-left")
(hitbox 16 14 32 64)
(mirror-action "santa-kick-right"))

(action
(name "santa-idle-right")
(fps 5.0)
(hitbox 16 14 32 64)
(images "big/idle-0.png"
"big/idle-1.png"
"big/idle-0.png"))

(action
(name "santa-idle-left")
(hitbox 16 14 32 64)
(mirror-action "santa-idle-right"))

(action
(name "santa-climbing-right")
(hitbox 16 14 32 64)
(images "big/ladder-0.png"
"big/ladder-1.png"
"big/ladder-2.png"
"big/ladder-3.png"
"big/ladder-2.png"
"big/ladder-1.png"))

(action
(name "santa-climbing-left")
(hitbox 16 14 32 64)
(mirror-action "santa-climbing-right"))

(action
(name "santa-duck-right")
(hitbox 16 45 32 32)
(images "big/duck-0.png"))

(action
(name "santa-duck-left")
(hitbox 16 45 32 32)
(mirror-action "santa-duck-right"))

(action
(name "santa-backflip-right")
(hitbox 16 37 32 32)
(images "big/backflip.png"))

(action
(name "santa-backflip-left")
(hitbox 16 37 32 32)
(fps 18.0)
(mirror-action "santa-backflip-right"))

(action
(name "santa-buttjump-right")
(hitbox 16 14 32 64)
(images "big/buttjump-0.png"))

(action
(name "santa-buttjump-left")
(hitbox 16 14 32 64)
(mirror-action "santa-buttjump-right"))

)
Binary file added data/images/objects/particles/santatux-hat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions data/images/objects/particles/santatux-hat.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(supertux-sprite
(action
(name "right")
(fps 1)
(images
"santatux-hat.png"
)
)
(action
(name "left")
(fps 1)
(mirror-action "right")
)
)
25 changes: 20 additions & 5 deletions src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "object/sprite_particle.hpp"
#include "scripting/squirrel_util.hpp"
#include "supertux/game_session.hpp"
#include "supertux/globals.hpp"
#include "supertux/gameconfig.hpp"
#include "supertux/sector.hpp"
#include "supertux/tile.hpp"
#include "trigger/climbable.hpp"
Expand Down Expand Up @@ -392,7 +392,8 @@ Player::update(float elapsed_time)
if (backflip_timer.started()) physic.set_velocity_x(100 * backflip_direction);
//rotate sprite during flip
sprite->set_angle(sprite->get_angle() + (dir==LEFT?1:-1) * elapsed_time * (360.0f / 0.5f));
if (player_status->bonus == EARTH_BONUS || player_status->bonus == AIR_BONUS) {
if (player_status->bonus == EARTH_BONUS || player_status->bonus == AIR_BONUS ||
(player_status->bonus == FIRE_BONUS && g_config->christmas_mode)) {
powersprite->set_angle(sprite->get_angle());
if (player_status->bonus == EARTH_BONUS)
lightsprite->set_angle(sprite->get_angle());
Expand Down Expand Up @@ -1104,7 +1105,12 @@ Player::set_bonus(BonusType type, bool animate)
Vector pspeed = Vector(((dir==LEFT) ? +100 : -100), -300);
Vector paccel = Vector(0, 1000);
std::string action = (dir==LEFT)?"left":"right";
Sector::current()->add_object(std::make_shared<SpriteParticle>("images/objects/particles/firetux-helmet.sprite", action, ppos, ANCHOR_TOP, pspeed, paccel, LAYER_OBJECTS-1));
if (g_config->christmas_mode) {
Sector::current()->add_object(std::make_shared<SpriteParticle>("images/objects/particles/santatux-hat.sprite", action, ppos,ANCHOR_TOP, pspeed, paccel, LAYER_OBJECTS-1));
}
else {
Sector::current()->add_object(std::make_shared<SpriteParticle>("images/objects/particles/firetux-helmet.sprite", action, ppos, ANCHOR_TOP, pspeed, paccel, LAYER_OBJECTS-1));
}
if (climbing) stop_climbing(*climbing);
}
if ((player_status->bonus == ICE_BONUS) && (animate)) {
Expand Down Expand Up @@ -1190,7 +1196,10 @@ Player::draw(DrawingContext& context)
if (player_status->bonus == GROWUP_BONUS)
sa_prefix = "big";
else if (player_status->bonus == FIRE_BONUS)
sa_prefix = "fire";
if(g_config->christmas_mode)
sa_prefix = "santa";
else
sa_prefix = "fire";
else if (player_status->bonus == ICE_BONUS)
sa_prefix = "ice";
else if (player_status->bonus == AIR_BONUS)
Expand Down Expand Up @@ -1275,8 +1284,11 @@ Player::draw(DrawingContext& context)
if (player_status->bonus == EARTH_BONUS) {
powersprite->set_action(sprite->get_action());
lightsprite->set_action(sprite->get_action());
} else if (player_status->bonus == AIR_BONUS)
} else if (player_status->bonus == AIR_BONUS) {
powersprite->set_action(sprite->get_action());
} else if (player_status->bonus == FIRE_BONUS && g_config->christmas_mode) {
powersprite->set_action(sprite->get_action());
}

/*
// Tux is holding something
Expand Down Expand Up @@ -1320,6 +1332,9 @@ Player::draw(DrawingContext& context)

if (player_status->bonus == AIR_BONUS)
powersprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
else if(player_status->bonus == FIRE_BONUS && g_config->christmas_mode) {
powersprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
}
}

}
Expand Down
8 changes: 7 additions & 1 deletion src/supertux/command_line_arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ CommandLineArguments::CommandLineArguments() :
enable_script_debugger(),
start_demo(),
record_demo(),
developer_mode()
developer_mode(),
christmas_mode()
{
}

Expand Down Expand Up @@ -266,6 +267,10 @@ CommandLineArguments::parse_args(int argc, char** argv)
{
developer_mode = true;
}
else if (arg == "--christmas")
{
christmas_mode = true;
}
else if (arg == "--console")
{
console_enabled = true;
Expand Down Expand Up @@ -339,6 +344,7 @@ CommandLineArguments::merge_into(Config& config)
merge_option(start_demo);
merge_option(record_demo);
merge_option(developer_mode);
merge_option(christmas_mode);

#undef merge_option
}
Expand Down
2 changes: 2 additions & 0 deletions src/supertux/command_line_arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class CommandLineArguments
boost::optional<std::string> record_demo;

boost::optional<bool> developer_mode;

boost::optional<bool> christmas_mode;

// boost::optional<std::string> locale;

Expand Down
12 changes: 11 additions & 1 deletion src/supertux/gameconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Config::Config() :
keyboard_config(),
joystick_config(),
addons(),
developer_mode(false)
developer_mode(false),
christmas_mode(false)
{
}

Expand All @@ -73,6 +74,12 @@ Config::load()
config_lisp->get("show_fps", show_fps);
config_lisp->get("console", console_enabled);
config_lisp->get("developer", developer_mode);
if(is_christmas()) {
if(!config_lisp->get("christmas", christmas_mode))
{
christmas_mode = true;
}
}
config_lisp->get("locale", locale);
config_lisp->get("random_seed", random_seed);

Expand Down Expand Up @@ -156,6 +163,9 @@ Config::save()
writer.write("show_fps", show_fps);
writer.write("console", console_enabled);
writer.write("developer", developer_mode);
if(is_christmas()) {
writer.write("christmas", christmas_mode);
}
writer.write("locale", locale);

writer.start_list("video");
Expand Down
Loading

0 comments on commit 9762ee8

Please sign in to comment.