X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsector.cpp;h=1420d7f422c17a0aa165dbb873487c0462a4f0ce;hb=e68610f027ad6f35025d9aca87202ceb4501e97e;hp=b980e8ed50c3177ce65a251cbe636461a45c0c56;hpb=e3366884d0487ca6e600f5d5dd5f0deabd782ea7;p=supertux.git diff --git a/src/sector.cpp b/src/sector.cpp index b980e8ed5..1420d7f42 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -45,8 +45,9 @@ Sector* Sector::_current = 0; Sector::Sector() - : gravity(10), player(0), solids(0), background(0), camera(0), - currentmusic(LEVEL_MUSIC), end_sequence_animation_type(NONE_ENDSEQ_ANIM) + : end_sequence_animation_type(NONE_ENDSEQ_ANIM), + gravity(10), player(0), solids(0), background(0), camera(0), + currentmusic(LEVEL_MUSIC) { song_title = "Mortimers_chipdisko.mod"; player = new Player(); @@ -667,7 +668,7 @@ Sector::add_score(const Vector& pos, int s) { global_stats.add_points(SCORE_STAT, s); - add_object(new FloatingScore(pos, s)); + add_object(new FloatingText(pos, s)); } void @@ -700,10 +701,12 @@ Sector::add_bouncy_brick(const Vector& pos) } BadGuy* -Sector::add_bad_guy(float x, float y, BadGuyKind kind) +Sector::add_bad_guy(float x, float y, BadGuyKind kind, bool activate) { BadGuy* badguy = new BadGuy(kind, x, y); add_object(badguy); + if(activate) + badguy->activate(LEFT); return badguy; } @@ -755,6 +758,12 @@ Sector::add_particles(const Vector& epicenter, const Vector& velocity, const Vec return true; } +void +Sector::add_floating_text(const Vector& pos, const std::string& text) +{ + add_object(new FloatingText(pos, text)); +} + /* Break a brick: */ bool Sector::trybreakbrick(const Vector& pos, bool small)