super-tux-commit Mailing List for Super Tux (Page 17)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Matze B. <mat...@us...> - 2004-11-25 00:52:24
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8227 Modified Files: .cvsignore Log Message: more stuff for .cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/super-tux/supertux/.cvsignore,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- .cvsignore 25 Nov 2004 00:51:04 -0000 1.8 +++ .cvsignore 25 Nov 2004 00:52:15 -0000 1.9 @@ -24,4 +24,6 @@ Jamconfig.in supertux *.exe +config.h.in +.sconf_temp |
From: Matze B. <mat...@us...> - 2004-11-25 00:51:14
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7948 Modified Files: .cvsignore Log Message: cvsignore updates and forgot all the time to add data/SConscript it seems... Index: .cvsignore =================================================================== RCS file: /cvsroot/super-tux/supertux/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- .cvsignore 20 Nov 2004 22:14:18 -0000 1.7 +++ .cvsignore 25 Nov 2004 00:51:04 -0000 1.8 @@ -20,4 +20,8 @@ .sconsign build_config.py build +Jamconfig +Jamconfig.in +supertux +*.exe |
From: Matze B. <mat...@us...> - 2004-11-25 00:51:14
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7948/data Added Files: SConscript Log Message: cvsignore updates and forgot all the time to add data/SConscript it seems... --- NEW FILE: SConscript --- import os Import('*') if 'install' in BUILD_TARGETS: patterns = ["*.txt", "levels/*/*.stl", "levels/*/*.stwm", "levelts/*/info", "sounds/*.wav", "music/*.mod", "music/*.ogg", "images/*/*.jpg", "images/*/*.png", "images/*/*/*.png", "images/*.xpm", "images/*.png", "images/*.strf", "images/tilesets/*.stgt"] files = [] for pattern in patterns: files = files + Glob(pattern) InstallData(files) |
From: Matze B. <mat...@us...> - 2004-11-25 00:50:14
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7497 Modified Files: TODO autogen.sh configure.ac Removed Files: Makefile.am Log Message: implement spikes as objects and remove automake system Index: configure.ac =================================================================== RCS file: /cvsroot/super-tux/supertux/configure.ac,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- configure.ac 23 Nov 2004 22:21:22 -0000 1.39 +++ configure.ac 25 Nov 2004 00:49:32 -0000 1.40 @@ -139,3 +139,6 @@ echo " Debug Mode: $enable_debug" echo " OpenGL Support: $enable_opengl" echo "" +echo "" +echo " NOTE: This project uses jam (and not make) as build tool" + --- Makefile.am DELETED --- Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- TODO 24 Nov 2004 23:10:01 -0000 1.90 +++ TODO 25 Nov 2004 00:49:32 -0000 1.91 @@ -44,12 +44,12 @@ few pixels higher) - hopefully ok * it's impossible to go into passages that have exactly the size of tux, either reduce collision rectangle by DELTA or round collision coordinates to - integers... + integers... - ok for tux and most badguys ** implement 1up - ok ** implement star - ok * bring back the enemies - - add activation again - - make api simpler + - add activation again - ok + - make api simpler - ok - implement jumpy - ok -* implement spiky - ok - implement snowball - ok @@ -69,7 +69,7 @@ for after big commit... * smoke clouds are too fast * some shots disappear in the ground with a "max collision depth reached" - message + message - ok * rework collision detection to take movement into account - this should fix the egg suddenly turning directions and the somtimes strange behaviour when hitting a block from the side when falling. @@ -89,7 +89,7 @@ ** having a star doesn't kill enemies - ok * tux always jumps to full height at the moment - ok * invisble blocks are visible and make the game crash when bumped - ok - * reimplement spikes as objects + * reimplement spikes as objects - ok * what to do when stuck under tiles (after using duck-sliding) * do we want multi hit scores again? * tux doesn't stop at igloo anymore Index: autogen.sh =================================================================== RCS file: /cvsroot/super-tux/supertux/autogen.sh,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- autogen.sh 23 Nov 2004 19:36:27 -0000 1.12 +++ autogen.sh 25 Nov 2004 00:49:32 -0000 1.13 @@ -18,11 +18,5 @@ echo 'INSTALL ?= "@INSTALL@" ;' >> Jamconfig.in echo 'JAMCONFIG_READ = yes ;' >> Jamconfig.in -# we need a minimum of automake 1.6 and automake 1.8 seems to be buggy -# this doesn't seem to work well -# see AUTOMAKE_OPTIONS in Makefile.am -export WANT_AUTOMAKE=1.6 - -automake --copy --add-missing autoconf |
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7497/src/badguy Modified Files: badguy.cpp bomb.cpp bouncing_snowball.cpp jumpy.cpp mrbomb.cpp mriceblock.cpp snowball.cpp spiky.cpp Added Files: spike.cpp spike.h Log Message: implement spikes as objects and remove automake system Index: bomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/bomb.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bomb.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ bomb.cpp 25 Nov 2004 00:49:34 -0000 1.3 @@ -9,7 +9,7 @@ { start_position = pos; bbox.set_pos(pos); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("bomb"); state = 0; timer.start(TICKINGTIME); Index: mrbomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mrbomb.cpp 24 Nov 2004 18:19:51 -0000 1.4 +++ mrbomb.cpp 25 Nov 2004 00:49:34 -0000 1.5 @@ -9,7 +9,7 @@ { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("mrbomb"); } @@ -17,7 +17,7 @@ { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("mrbomb"); } Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- badguy.cpp 24 Nov 2004 23:10:05 -0000 1.5 +++ badguy.cpp 25 Nov 2004 00:49:34 -0000 1.6 @@ -25,9 +25,9 @@ if(state == STATE_INIT || state == STATE_INACTIVE) return; if(state == STATE_FALLING) { - sprite->draw(context, get_pos(), LAYER_OBJECTS, VERTICAL_FLIP); + sprite->draw(context, get_pos(), LAYER_OBJECTS, VERTICAL_FLIP); } else { - sprite->draw(context, get_pos(), LAYER_OBJECTS); + sprite->draw(context, get_pos(), LAYER_OBJECTS); } } Index: mriceblock.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mriceblock.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mriceblock.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ mriceblock.cpp 25 Nov 2004 00:49:34 -0000 1.3 @@ -11,7 +11,7 @@ { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("mriceblock"); } Index: snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/snowball.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- snowball.cpp 24 Nov 2004 18:19:51 -0000 1.3 +++ snowball.cpp 25 Nov 2004 00:49:34 -0000 1.4 @@ -8,7 +8,7 @@ { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("snowball"); } @@ -16,7 +16,7 @@ { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("snowball"); } Index: jumpy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/jumpy.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jumpy.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ jumpy.cpp 25 Nov 2004 00:49:34 -0000 1.3 @@ -8,7 +8,7 @@ { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("jumpy"); } --- NEW FILE: spike.cpp --- #include "spike.h" Spike::Spike(const Vector& pos, Direction dir) { sprite = sprite_manager->create("spike"); start_position = pos; bbox.set_pos(Vector(0, 0)); bbox.set_size(32, 32); set_direction(dir); } Spike::Spike(LispReader& reader) { sprite = sprite_manager->create("spike"); reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); bbox.set_size(32, 32); int idir = 0; reader.read_int("direction", idir); set_direction((Direction) idir); } void Spike::set_direction(Direction dir) { spikedir = dir; switch(spikedir) { case NORTH: sprite->set_action("north"); break; case SOUTH: sprite->set_action("south"); break; case WEST: sprite->set_action("west"); break; case EAST: sprite->set_action("east"); break; default: break; } } void Spike::write(LispWriter& writer) { writer.start_list("spike"); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); writer.write_int("direction", spikedir); writer.end_list("spike"); } void Spike::kill_fall() { // you can't kill a spike } void Spike::active_action(float ) { } --- NEW FILE: spike.h --- #ifndef __SPIKE_H__ #define __SPIKE_H__ #include "badguy.h" class Spike : public BadGuy { public: enum Direction { NORTH=0, SOUTH, WEST, EAST }; Spike(const Vector& pos, Direction dir); Spike(LispReader& reader); void active_action(float elapsed_time); void write(LispWriter& writer); void kill_fall(); private: void set_direction(Direction dir); Direction spikedir; }; #endif Index: bouncing_snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/bouncing_snowball.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- bouncing_snowball.cpp 24 Nov 2004 17:33:49 -0000 1.3 +++ bouncing_snowball.cpp 25 Nov 2004 00:49:34 -0000 1.4 @@ -9,7 +9,7 @@ { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("bouncingsnowball"); } @@ -17,7 +17,7 @@ { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("bouncingsnowball"); } Index: spiky.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/spiky.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- spiky.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ spiky.cpp 25 Nov 2004 00:49:34 -0000 1.3 @@ -8,7 +8,7 @@ { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("spiky"); } |
From: Matze B. <mat...@us...> - 2004-11-25 00:49:44
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7497/src Modified Files: player.cpp sector.cpp sector.h Removed Files: Makefile.am badguy_specs.cpp badguy_specs.h Log Message: implement spikes as objects and remove automake system --- Makefile.am DELETED --- Index: sector.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- sector.h 22 Nov 2004 23:47:49 -0000 1.24 +++ sector.h 25 Nov 2004 00:49:34 -0000 1.25 @@ -124,7 +124,7 @@ void collision_object(MovingObject* object1, MovingObject* object2); void load_music(); - GameObject* parseObject(const std::string& name, LispReader& reader); + GameObject* parse_object(const std::string& name, LispReader& reader); static Sector* _current; Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- sector.cpp 24 Nov 2004 23:10:04 -0000 1.46 +++ sector.cpp 25 Nov 2004 00:49:33 -0000 1.47 @@ -46,7 +46,6 @@ #include "object/block.h" #include "object/invisible_block.h" #include "object/platform.h" -#include "trigger/door.h" #include "object/bullet.h" #include "badguy/jumpy.h" #include "badguy/snowball.h" @@ -55,6 +54,8 @@ #include "badguy/mriceblock.h" #include "badguy/mrbomb.h" #include "badguy/dispenser.h" +#include "badguy/spike.h" +#include "trigger/door.h" #include "trigger/sequence_trigger.h" #include "trigger/secretarea_trigger.h" @@ -102,7 +103,7 @@ } GameObject* -Sector::parseObject(const std::string& name, LispReader& reader) +Sector::parse_object(const std::string& name, LispReader& reader) { if(name == "background") { background = new Background(reader); @@ -155,6 +156,8 @@ return new MrBomb(reader); } else if(name == "dispenser") { return new Dispenser(reader); + } else if(name == "spike") { + return new Spike(reader); } #if 0 else if(badguykind_from_string(name) != BAD_INVALID) { @@ -195,7 +198,7 @@ reader.read_float("y", sp->pos.y); spawnpoints.push_back(sp); } else { - GameObject* object = parseObject(token, reader); + GameObject* object = parse_object(token, reader); if(object) { add_object(object); } @@ -330,7 +333,7 @@ LispReader reader(lisp_cdr(data)); - GameObject* object = parseObject(object_type, reader); + GameObject* object = parse_object(object_type, reader); if(object) { add_object(object); } else { @@ -359,6 +362,18 @@ if(tile->id == 112) { add_object(new InvisibleBlock(pos)); solids->change(x, y, 0); + } else if(tile->id == 295) { + add_object(new Spike(pos, Spike::NORTH)); + solids->change(x, y, 0); + } else if(tile->id == 296) { + add_object(new Spike(pos, Spike::EAST)); + solids->change(x, y, 0); + } else if(tile->id == 297) { + add_object(new Spike(pos, Spike::SOUTH)); + solids->change(x, y, 0); + } else if(tile->id == 298) { + add_object(new Spike(pos, Spike::WEST)); + solids->change(x, y, 0); } else if(tile->attributes & Tile::COIN) { add_object(new Coin(pos)); solids->change(x, y, 0); Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.205 retrieving revision 1.206 diff -u -d -r1.205 -r1.206 --- player.cpp 24 Nov 2004 23:10:02 -0000 1.205 +++ player.cpp 25 Nov 2004 00:49:33 -0000 1.206 @@ -870,8 +870,7 @@ physic.set_velocity_y(.1); } - if(fabsf(hit.normal.x) > .5) { // hit on the side? - printf("s"); fflush(stdout); + if(fabsf(hit.normal.x) > .9) { // hit on the side? physic.set_velocity_x(0); } --- badguy_specs.cpp DELETED --- --- badguy_specs.h DELETED --- |
From: Matze B. <mat...@us...> - 2004-11-25 00:49:43
|
Update of /cvsroot/super-tux/supertux/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7497/lib Removed Files: Makefile.am Log Message: implement spikes as objects and remove automake system --- Makefile.am DELETED --- |
From: Matze B. <mat...@us...> - 2004-11-25 00:49:41
|
Update of /cvsroot/super-tux/supertux/data/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7497/data/images Modified Files: supertux.strf Log Message: implement spikes as objects and remove automake system Index: supertux.strf =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/supertux.strf,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- supertux.strf 23 Nov 2004 02:00:29 -0000 1.24 +++ supertux.strf 25 Nov 2004 00:49:32 -0000 1.25 @@ -782,6 +782,24 @@ ;; Bad Guys follow + (sprite (name "spike") + (action + (name "north") + (images "tilesets/spike_up.png") + ) + (action + (name "south") + (images "tilesets/spike_down.png") + ) + (action + (name "west") + (images "tilesets/spike_left.png") + ) + (action + (name "east") + (images "tilesets/spike_right.png") + ) + ) ;; MrIceBlock (sprite (name "mriceblock") |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:49
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564/lib/app Modified Files: setup.cpp tinygettext.cpp tinygettext.h Log Message: some cleanups in the sprite class, increased delta for collision response Index: tinygettext.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/tinygettext.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tinygettext.h 23 Nov 2004 22:21:50 -0000 1.1 +++ tinygettext.h 24 Nov 2004 23:10:01 -0000 1.2 @@ -104,13 +104,14 @@ SearchPath search_path; typedef std::map<std::string, std::string> Aliases; Aliases language_aliases; + std::string charset; std::string language; Dictionary* current_dict; Dictionary empty_dict; public: DictionaryManager(); - + /** Return the currently active dictionary, if none is set, an empty dictionary is returned. */ Dictionary& get_dictionary() @@ -122,6 +123,9 @@ /** Set a language based on a four? letter country code */ void set_language(const std::string& langspec); + /** Set a charset that will be set on the returned dictionaries */ + void set_charset(const std::string& charset); + /** Define an alias for a language */ void set_language_alias(const std::string& alias, const std::string& lang); Index: tinygettext.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/tinygettext.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tinygettext.cpp 23 Nov 2004 22:49:04 -0000 1.2 +++ tinygettext.cpp 24 Nov 2004 23:10:01 -0000 1.3 @@ -237,6 +237,8 @@ Dictionary& dict = dictionaries[lang]; dict.set_language(get_language_def(lang)); + if(charset != "") + dict.set_charset(charset); for (SearchPath::iterator p = search_path.begin(); p != search_path.end(); ++p) { @@ -309,6 +311,14 @@ } void +DictionaryManager::set_charset(const std::string& charset) +{ + dictionaries.clear(); // changing charset invalidates cache + this->charset = charset; + set_language(language); +} + +void DictionaryManager::set_language_alias(const std::string& alias, const std::string& language) { @@ -334,9 +344,8 @@ void DictionaryManager::add_directory(const std::string& pathname) { + dictionaries.clear(); // adding directories invalidates cache search_path.push_back(pathname); - // cache is outdated now - dictionaries.clear(); set_language(language); } Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- setup.cpp 24 Nov 2004 14:10:20 -0000 1.19 +++ setup.cpp 24 Nov 2004 23:10:01 -0000 1.20 @@ -262,6 +262,7 @@ directories(); dictionary_manager.add_directory(datadir + "/locale"); + dictionary_manager.set_charset("iso8859-1"); } /* --- SETUP --- */ |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:49
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564/src Modified Files: player.cpp player.h sector.cpp Log Message: some cleanups in the sprite class, increased delta for collision response Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.204 retrieving revision 1.205 diff -u -d -r1.204 -r1.205 --- player.cpp 24 Nov 2004 14:10:25 -0000 1.204 +++ player.cpp 24 Nov 2004 23:10:02 -0000 1.205 @@ -91,29 +91,16 @@ } void -TuxBodyParts::set_action(std::string action) -{ - if(head != NULL) - head->set_action(action); - if(body != NULL) - body->set_action(action); - if(arms != NULL) - arms->set_action(action); - if(feet != NULL) - feet->set_action(action); -} - -void -TuxBodyParts::one_time_animation() +TuxBodyParts::set_action(std::string action, int loops) { if(head != NULL) - head->start_animation(1); + head->set_action(action, loops); if(body != NULL) - body->start_animation(1); + body->set_action(action, loops); if(arms != NULL) - arms->start_animation(1); + arms->set_action(action, loops); if(feet != NULL) - feet->start_animation(1); + feet->set_action(action, loops); } void @@ -789,11 +776,9 @@ if(size == BIG) { if(dir == LEFT) - tux_body->head->set_action("idle-left"); + tux_body->head->set_action("idle-left", 1); else // dir == RIGHT - tux_body->head->set_action("idle-right"); - - tux_body->head->start_animation(1); + tux_body->head->set_action("idle-right", 1); } } Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- player.h 22 Nov 2004 21:35:04 -0000 1.94 +++ player.h 24 Nov 2004 23:10:03 -0000 1.95 @@ -111,7 +111,7 @@ delete feet; } - void set_action(std::string action); + void set_action(std::string action, int loops = -1); void one_time_animation(); void draw(DrawingContext& context, const Vector& pos, int layer, Uint32 drawing_effect = NONE_EFFECT); Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- sector.cpp 24 Nov 2004 17:33:49 -0000 1.45 +++ sector.cpp 24 Nov 2004 23:10:04 -0000 1.46 @@ -600,6 +600,8 @@ context.pop_transform(); } +static const float DELTA = .001; + void Sector::collision_tilemap(MovingObject* object, int depth) { @@ -701,7 +703,7 @@ return; } // move out of collision and try again - object->movement += hit.normal * (hit.depth + .05); + object->movement += hit.normal * (hit.depth + DELTA); collision_tilemap(object, depth+1); } @@ -724,15 +726,15 @@ if(response1 == ABORT_MOVE) object1->movement = Vector(0, 0); if(response2 == CONTINUE) - object2->movement += hit.normal * (hit.depth + .05); + object2->movement += hit.normal * (hit.depth + DELTA); } else if(response2 != CONTINUE) { if(response2 == ABORT_MOVE) object2->movement = Vector(0, 0); if(response1 == CONTINUE) - object1->movement += -hit.normal * (hit.depth + .05); + object1->movement += -hit.normal * (hit.depth + DELTA); } else { - object1->movement += -hit.normal * (hit.depth/2 + .05); - object2->movement += hit.normal * (hit.depth/2 + .05); + object1->movement += -hit.normal * (hit.depth/2 + DELTA); + object2->movement += hit.normal * (hit.depth/2 + DELTA); } } } @@ -743,12 +745,16 @@ for(std::vector<GameObject*>::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) { GameObject* gameobject = *i; - if(!gameobject->is_valid() - || gameobject->get_flags() & GameObject::FLAG_NO_COLLDET) + if(!gameobject->is_valid()) continue; MovingObject* movingobject = dynamic_cast<MovingObject*> (gameobject); if(!movingobject) continue; + if(movingobject->get_flags() & GameObject::FLAG_NO_COLLDET) { + movingobject->bbox.move(movingobject->movement); + movingobject->movement = Vector(0, 0); + continue; + } // collision with tilemap if(! (movingobject->movement == Vector(0, 0))) |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:48
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564/src/badguy Modified Files: badguy.cpp dispenser.cpp Log Message: some cleanups in the sprite class, increased delta for collision response Index: dispenser.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dispenser.cpp 24 Nov 2004 18:19:51 -0000 1.3 +++ dispenser.cpp 24 Nov 2004 23:10:05 -0000 1.4 @@ -45,7 +45,7 @@ } void -Dispenser::active_action(float elapsed_time) +Dispenser::active_action(float ) { if (dispense_timer.check()) { launch_badguy(); Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- badguy.cpp 23 Nov 2004 16:47:26 -0000 1.4 +++ badguy.cpp 24 Nov 2004 23:10:05 -0000 1.5 @@ -194,6 +194,9 @@ } flags |= FLAG_NO_COLLDET; break; + case STATE_FALLING: + flags |= FLAG_NO_COLLDET; + break; default: break; } |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:48
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564/lib/special Modified Files: collision_hit.h sprite.cpp sprite.h Log Message: some cleanups in the sprite class, increased delta for collision response Index: collision_hit.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision_hit.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- collision_hit.h 24 Nov 2004 14:10:23 -0000 1.2 +++ collision_hit.h 24 Nov 2004 23:10:02 -0000 1.3 @@ -30,10 +30,15 @@ */ enum HitResponse { - ABORT_MOVE, // don't move the object - FORCE_MOVE, // do the move ignoring the collision - CONTINUE // move object out of collision and check for collisions again - // if this happens to often then the move will just be aborted + // note: keep the elements in this order + + /// don't move the object + ABORT_MOVE = 0, + /// move object out of collision and check for collisions again + /// if this happens to often then the move will just be aborted + CONTINUE, + /// do the move ignoring the collision + FORCE_MOVE }; /** Index: sprite.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- sprite.cpp 24 Nov 2004 14:10:23 -0000 1.32 +++ sprite.cpp 24 Nov 2004 23:10:02 -0000 1.33 @@ -32,17 +32,18 @@ { Sprite::Sprite(SpriteData& newdata) - : data(newdata) + : data(newdata), frame(0), animation_loops(-1) { action = data.actions.begin()->second; - reset(); + last_ticks = SDL_GetTicks(); } Sprite::Sprite(const Sprite& other) : data(other.data), frame(other.frame), - animation_loops(other.animation_loops), last_tick(other.last_tick), - action(other.action), next_action(other.next_action) + animation_loops(other.animation_loops), + action(other.action) { + last_ticks = SDL_GetTicks(); } Sprite::~Sprite() @@ -50,34 +51,22 @@ } void -Sprite::set_action(std::string name) +Sprite::set_action(std::string name, int loops) { - if(!next_action.empty() && animation_loops > 0) { - next_action = name; + if(action && action->name == name) return; - } + SpriteData::Action* newaction = data.get_action(name); - if(!action) + if(!action) { +#ifdef DEBUG + std::cerr << "Action '" << name << "' not found.\n"; +#endif return; + } action = newaction; -} - -void -Sprite::start_animation(int loops) -{ - reset(); animation_loops = loops; -} - -void -Sprite::reset() -{ frame = 0; - last_tick = SDL_GetTicks(); - animation_reversed = false; - animation_loops = -1; - next_action.clear(); } bool @@ -87,71 +76,24 @@ } void -Sprite::reverse_animation(bool reverse) -{ - animation_reversed = reverse; - - if(animation_reversed) - frame = get_frames()-1; - else - frame = 0; -} - -void Sprite::update() { if(animation_loops == 0) - { - if(frame >= get_frames() || frame < 0) - frame = 0; return; - } - - float frame_inc = (action->fps/1000.0) * (SDL_GetTicks() - last_tick); - last_tick = SDL_GetTicks(); - - if(animation_reversed) - frame -= frame_inc; - else - frame += frame_inc; - if(animation_reversed) { - if(frame < 0 || frame >= (float)get_frames()) { - // last case can happen when not used reverse_animation() - float excedent = frame - 0; - frame = get_frames() - 1; - if(animation_loops > 0) - { - animation_loops--; - if(animation_loops == 0 && !next_action.empty()) - { - set_action(next_action); - start_animation(-1); - } - } + Uint32 ticks = SDL_GetTicks(); + float frame_inc = action->fps * float(ticks - last_ticks)/1000.0; + last_ticks = ticks; - if(fabsf(excedent) < get_frames()) - frame += excedent; - } - } - else - { - if(frame >= (float)get_frames()) - { - float excedent = frame - get_frames(); - frame = 0; - if(animation_loops > 0) - { - animation_loops--; - if(animation_loops == 0 && !next_action.empty()) - { - set_action(next_action); - start_animation(-1); - } - } + frame += frame_inc; - if(excedent < get_frames()) - frame += excedent; + float lastframe = frame; + frame = fmodf(frame+get_frames(), get_frames()); + if(frame != lastframe) { + if(animation_loops > 0) { + animation_loops--; + if(animation_loops == 0) + frame = 0; } } } Index: sprite.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- sprite.h 24 Nov 2004 14:10:23 -0000 1.18 +++ sprite.h 24 Nov 2004 23:10:02 -0000 1.19 @@ -22,6 +22,7 @@ #include <string> #include <vector> +#include <cassert> #include <map> #include "utils/lispreader.h" @@ -47,20 +48,13 @@ Uint32 drawing_effect = NONE_EFFECT); /** Set action (or state) */ - void set_action(std::string act); + void set_action(std::string act, int loops = -1); - /* Start an animation - -1 - for infinite - 0 - stopped - 1,2,3 - one, two, three times... */ - void start_animation(int loops); /* Stop animation */ void stop_animation() - { start_animation(0); } + { animation_loops = 0; } /** Check if animation is stopped or not */ bool check_animation(); - /** Reverse the animation */ - void reverse_animation(bool reverse); float get_fps() const { return action->fps; } @@ -85,24 +79,20 @@ { if(frame_ > get_frames()) frame = 0; else frame = frame_; } Surface* get_frame(unsigned int frame) { - if(frame < action->surfaces.size()) - return action->surfaces[frame]; - else - return action->surfaces[0]; + assert(frame < action->surfaces.size()); + return action->surfaces[frame]; } + private: void update(); - void reset(); SpriteData& data; float frame; int animation_loops; - bool animation_reversed; - float last_tick; + Uint32 last_ticks; SpriteData::Action* action; - std::string next_action; }; } //namespace SuperTux |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:45
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564 Modified Files: TODO Log Message: some cleanups in the sprite class, increased delta for collision response Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- TODO 24 Nov 2004 16:56:32 -0000 1.89 +++ TODO 24 Nov 2004 23:10:01 -0000 1.90 @@ -110,6 +110,7 @@ themselfes. This could speed up rendering of tilemaps. [H] implement quadtree to speed up collision detection [?] remove badguyspecs and bitmask files +[M] Make the gamelogic run in a fixed logical framerate --Miscellaneous-- [?] think about how to implement scripting, and how to make a simple and easy to |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:22
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564/src/trigger Modified Files: door.cpp Log Message: some cleanups in the sprite class, increased delta for collision response Index: door.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/door.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- door.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ door.cpp 24 Nov 2004 23:10:09 -0000 1.3 @@ -90,8 +90,7 @@ Door::event(Player& , EventType type) { if(type == EVENT_ACTIVATE) { - sprite->set_action("open"); - sprite->start_animation(1); + sprite->set_action("open", 1); } } |
From: Matze B. <mat...@us...> - 2004-11-24 23:10:21
|
Update of /cvsroot/super-tux/supertux/src/object In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16564/src/object Modified Files: block.cpp coin.cpp coin.h Log Message: some cleanups in the sprite class, increased delta for collision response Index: coin.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/coin.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- coin.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ coin.cpp 24 Nov 2004 23:10:07 -0000 1.3 @@ -5,7 +5,9 @@ #include "video/drawing_context.h" #include "special/sprite_manager.h" #include "player.h" +#include "sector.h" #include "scene.h" +#include "gameobjs.h" Coin::Coin(const Vector& pos) { @@ -30,6 +32,14 @@ sprite->draw(context, get_pos(), LAYER_TILES); } +void +Coin::collect() +{ + Sector::current()->player->get_status().incCoins(); + Sector::current()->add_object(new BouncyCoin(get_pos())); + remove_me(); +} + HitResponse Coin::collision(GameObject& other, const CollisionHit& ) { @@ -37,8 +47,7 @@ if(player == 0) return ABORT_MOVE; - player->get_status().incCoins(); - remove_me(); + collect(); return ABORT_MOVE; } Index: block.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/block.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- block.cpp 24 Nov 2004 14:10:27 -0000 1.5 +++ block.cpp 24 Nov 2004 23:10:05 -0000 1.6 @@ -13,6 +13,8 @@ #include "flower.h" #include "oneup.h" #include "star.h" +#include "badguy/badguy.h" +#include "coin.h" static const float BOUNCY_BRICK_MAX_OFFSET=8; static const float BOUNCY_BRICK_SPEED=90; @@ -35,8 +37,6 @@ HitResponse Block::collision(GameObject& other, const CollisionHit& hitdata) { - // TODO kill badguys when bumping them... - Player* player = dynamic_cast<Player*> (&other); if(player) { // collided from below? @@ -45,6 +45,17 @@ } } + if(bouncing) { + BadGuy* badguy = dynamic_cast<BadGuy*> (&other); + if(badguy) { + badguy->kill_fall(); + } + Coin* coin = dynamic_cast<Coin*> (&other); + if(coin) { + coin->collect(); + } + } + return FORCE_MOVE; } Index: coin.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/coin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- coin.h 20 Nov 2004 22:14:40 -0000 1.1 +++ coin.h 24 Nov 2004 23:10:07 -0000 1.2 @@ -19,6 +19,8 @@ virtual void action(float elapsed_time); virtual void draw(DrawingContext& context); + void collect(); + private: Sprite* sprite; }; |
From: Ingo R. <gr...@us...> - 2004-11-24 22:26:13
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6887 Modified Files: supertux.stgt Log Message: added some missing tiles Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- supertux.stgt 24 Nov 2004 12:57:36 -0000 1.60 +++ supertux.stgt 24 Nov 2004 22:26:02 -0000 1.61 @@ -7,16 +7,16 @@ 13 14 15 204 10 11 12 206 16 17 18 205 - 22 21 207 208 - 23 20 114 113 - 31 30 115 116 - 122 123 117 118 - 124 125 19 210 - - 33 32 34 0 - 35 37 39 0 + 22 21 19 203 + 23 20 207 208 + 31 30 114 113 + 115 116 122 123 + 117 118 124 125 + 33 32 34 209 + 35 37 39 210 38 36 43 0 40 41 42 0 + 119 121 120 0 ) ) @@ -50,6 +50,7 @@ 0 1088 1089 1090 1095 1096 1097 1098 1103 1104 1105 1106 + 1111 1112 1113 1114 1119 1120 1121 1122 1127 1128 1129 1130 0 0 1137 1138 @@ -61,6 +62,7 @@ 1091 1092 0 0 1099 1100 1101 0 1107 1108 1109 1110 + 1115 1116 1117 1118 1123 1124 1125 1126 1131 1132 1133 1134 1139 1140 1141 0 |
From: Ryan F. <sik...@us...> - 2004-11-24 18:29:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14728 Modified Files: gameloop.cpp Log Message: - oops.. accidentally deleted a line Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.200 retrieving revision 1.201 diff -u -d -r1.200 -r1.201 --- gameloop.cpp 24 Nov 2004 18:22:22 -0000 1.200 +++ gameloop.cpp 24 Nov 2004 18:29:26 -0000 1.201 @@ -466,6 +466,7 @@ if(compare_last(last_keys, "grid")) { // toggle debug grid debug_grid = !debug_grid; + last_keys.clear(); } if(compare_last(last_keys, "hover")) { // toggle hover ability on/off |
From: Ryan F. <sik...@us...> - 2004-11-24 18:22:40
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13283/src Modified Files: tilemap.cpp gameloop.cpp Log Message: - added debug grid. type 'grid' in-game to toggle Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- tilemap.cpp 22 Nov 2004 21:35:04 -0000 1.22 +++ tilemap.cpp 24 Nov 2004 18:22:22 -0000 1.23 @@ -160,6 +160,21 @@ } } + if (debug_grid) + { + for (pos.x = start_x; pos.x < end_x; pos.x += 32) + { + context.draw_filled_rect(Vector (pos.x, start_y), Vector(1, fabsf(start_y - end_y)), + Color(225, 225, 225), LAYER_GUI-50); + } + + for (pos.y = start_y; pos.y < end_y; pos.y += 32) + { + context.draw_filled_rect(Vector (start_x, pos.y), Vector(fabsf(start_x - end_x), 1), + Color(225, 225, 225), LAYER_GUI-50); + } + } + context.pop_transform(); } Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.199 retrieving revision 1.200 diff -u -d -r1.199 -r1.200 --- gameloop.cpp 24 Nov 2004 14:10:25 -0000 1.199 +++ gameloop.cpp 24 Nov 2004 18:22:22 -0000 1.200 @@ -463,6 +463,10 @@ tux.kill(tux.KILL); last_keys.clear(); } + if(compare_last(last_keys, "grid")) + { // toggle debug grid + debug_grid = !debug_grid; + } if(compare_last(last_keys, "hover")) { // toggle hover ability on/off tux.enable_hover = !tux.enable_hover; |
From: Ryan F. <sik...@us...> - 2004-11-24 18:22:38
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13283/lib/app Modified Files: globals.cpp globals.h Log Message: - added debug grid. type 'grid' in-game to toggle Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- globals.cpp 23 Nov 2004 22:21:49 -0000 1.11 +++ globals.cpp 24 Nov 2004 18:22:21 -0000 1.12 @@ -56,6 +56,7 @@ bool use_fullscreen; bool debug_mode; bool show_fps; +bool debug_grid = false; int joystick_num = 0; char* level_startup_file = 0; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- globals.h 24 Nov 2004 14:10:20 -0000 1.11 +++ globals.h 24 Nov 2004 18:22:21 -0000 1.12 @@ -67,6 +67,7 @@ extern bool use_fullscreen; extern bool debug_mode; extern bool show_fps; + extern bool debug_grid; /** The number of the joystick that will be use in the game */ extern int joystick_num; |
From: Marek M. <wa...@us...> - 2004-11-24 18:20:22
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12560/data/levels/test Modified Files: bonusblock.stl Log Message: dispenser can now launch snowballs and bouncingsnowballs Index: bonusblock.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/bonusblock.stl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- bonusblock.stl 24 Nov 2004 17:45:25 -0000 1.6 +++ bonusblock.stl 24 Nov 2004 18:19:51 -0000 1.7 @@ -10,7 +10,7 @@ (background (image "arctis.jpg") (speed 0.5)) (secretarea (x 400) (y 128) (message "You found a secret area!")) - (dispenser (x 500) (y 128) (badguy "snowball") (cycle 3)) + (dispenser (x 500) (y 128) (badguy "bouncingsnowball") (cycle 2)) (spawn-points (name "main") (x 100) |
From: Marek M. <wa...@us...> - 2004-11-24 18:20:07
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12560/src/badguy Modified Files: badguy.h dispenser.cpp dispenser.h mrbomb.cpp mrbomb.h snowball.cpp snowball.h Log Message: dispenser can now launch snowballs and bouncingsnowballs Index: snowball.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/snowball.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- snowball.h 20 Nov 2004 22:14:40 -0000 1.1 +++ snowball.h 24 Nov 2004 18:19:51 -0000 1.2 @@ -7,6 +7,7 @@ { public: SnowBall(LispReader& reader); + SnowBall(float pos_x, float pos_y); void activate(); void write(LispWriter& writer); Index: dispenser.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dispenser.h 24 Nov 2004 17:45:26 -0000 1.2 +++ dispenser.h 24 Nov 2004 18:19:51 -0000 1.3 @@ -16,6 +16,7 @@ protected: bool collision_squished(Player& player); + void launch_badguy(); float cycle; std::string badguy; Timer2 dispense_timer; Index: snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/snowball.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- snowball.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ snowball.cpp 24 Nov 2004 18:19:51 -0000 1.3 @@ -12,6 +12,14 @@ sprite = sprite_manager->create("snowball"); } +SnowBall::SnowBall(float pos_x, float pos_y) +{ + start_position.x = pos_x; + start_position.y = pos_y; + bbox.set_size(32, 32); + sprite = sprite_manager->create("snowball"); +} + void SnowBall::write(LispWriter& writer) { Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- badguy.h 20 Nov 2004 22:14:39 -0000 1.1 +++ badguy.h 24 Nov 2004 18:19:51 -0000 1.2 @@ -84,11 +84,12 @@ * initial position of the enemy. Also the position where enemy respawns when * after being deactivated. */ + bool is_offscreen(); + Vector start_position; Direction dir; private: - bool is_offscreen(); void try_activate(); State state; Index: dispenser.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dispenser.cpp 24 Nov 2004 17:45:26 -0000 1.2 +++ dispenser.cpp 24 Nov 2004 18:19:51 -0000 1.3 @@ -2,6 +2,8 @@ #include "dispenser.h" #include "badguy/bouncing_snowball.h" +#include "badguy/snowball.h" + Dispenser::Dispenser(LispReader& reader) { @@ -10,6 +12,7 @@ reader.read_float("cycle", cycle); reader.read_string("badguy", badguy); bbox.set_size(32, 32); + //FIXME: Create dispenser sprite sprite = sprite_manager->create("snowball"); } @@ -28,8 +31,9 @@ void Dispenser::activate() -{ +{ dispense_timer.start(cycle, true); + launch_badguy(); } bool @@ -44,7 +48,7 @@ Dispenser::active_action(float elapsed_time) { if (dispense_timer.check()) { - Sector::current()->add_object(new BouncingSnowball(get_pos().x, get_pos().y)); + launch_badguy(); } } @@ -61,3 +65,21 @@ return CONTINUE; } + +//TODO: Add launching velocity to badguys +// Add more badguys and randomizer +// Clean up stuff I copied without understanding what it does :) +// Lots-O-Stuff (tm) +void +Dispenser::launch_badguy() +{ + //FIXME: Does is_offscreen() work right here? + if (!is_offscreen()) { + if (badguy == "snowball") + Sector::current()->add_object(new SnowBall(get_pos().x-2, get_pos().y)); + else if (badguy == "bouncingsnowball") + Sector::current()->add_object(new BouncingSnowball(get_pos().x-2, get_pos().y)); + else if (badguy == "random") + {} + } +} Index: mrbomb.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mrbomb.h 20 Nov 2004 22:14:39 -0000 1.1 +++ mrbomb.h 24 Nov 2004 18:19:51 -0000 1.2 @@ -7,6 +7,7 @@ { public: MrBomb(LispReader& reader); + MrBomb(float pos_x, float pos_y); void activate(); void write(LispWriter& writer); Index: mrbomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mrbomb.cpp 24 Nov 2004 17:33:50 -0000 1.3 +++ mrbomb.cpp 24 Nov 2004 18:19:51 -0000 1.4 @@ -13,6 +13,14 @@ sprite = sprite_manager->create("mrbomb"); } +MrBomb::MrBomb(float pos_x, float pos_y) +{ + start_position.x = pos_x; + start_position.y = pos_y; + bbox.set_size(32, 32); + sprite = sprite_manager->create("mrbomb"); +} + void MrBomb::write(LispWriter& writer) { |
From: Marek M. <wa...@us...> - 2004-11-24 17:45:40
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4140/data/levels/test Modified Files: bonusblock.stl Log Message: made badguy dispenser cycle configurable in level file Index: bonusblock.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/bonusblock.stl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- bonusblock.stl 24 Nov 2004 17:33:49 -0000 1.5 +++ bonusblock.stl 24 Nov 2004 17:45:25 -0000 1.6 @@ -10,7 +10,7 @@ (background (image "arctis.jpg") (speed 0.5)) (secretarea (x 400) (y 128) (message "You found a secret area!")) - (dispenser (x 500) (y 128) (badguy "snowball")) + (dispenser (x 500) (y 128) (badguy "snowball") (cycle 3)) (spawn-points (name "main") (x 100) |
From: Marek M. <wa...@us...> - 2004-11-24 17:45:38
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4140/src/badguy Modified Files: dispenser.cpp dispenser.h Log Message: made badguy dispenser cycle configurable in level file Index: dispenser.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dispenser.cpp 24 Nov 2004 17:33:50 -0000 1.1 +++ dispenser.cpp 24 Nov 2004 17:45:26 -0000 1.2 @@ -3,12 +3,11 @@ #include "dispenser.h" #include "badguy/bouncing_snowball.h" -#define DISPENSE_TIME 3 - Dispenser::Dispenser(LispReader& reader) { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); + reader.read_float("cycle", cycle); reader.read_string("badguy", badguy); bbox.set_size(32, 32); sprite = sprite_manager->create("snowball"); @@ -21,6 +20,7 @@ writer.write_float("x", get_pos().x); writer.write_float("y", get_pos().y); + writer.write_float("cycle", cycle); writer.write_string("badguy", badguy); writer.end_list("dispenser"); @@ -29,7 +29,7 @@ void Dispenser::activate() { - dispense_timer.start(DISPENSE_TIME, true); + dispense_timer.start(cycle, true); } bool Index: dispenser.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dispenser.h 24 Nov 2004 17:33:50 -0000 1.1 +++ dispenser.h 24 Nov 2004 17:45:26 -0000 1.2 @@ -16,6 +16,7 @@ protected: bool collision_squished(Player& player); + float cycle; std::string badguy; Timer2 dispense_timer; }; |
From: Marek M. <wa...@us...> - 2004-11-24 17:34:06
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1377/src/trigger Modified Files: secretarea_trigger.cpp secretarea_trigger.h Log Message: added simple enemy dispenser (can only dispense bouncing snowballs so far and looks like a snowball) it's in data/test/bonusblocks.stl, right behind the secret area ;-) fixed typo(?) in mrbomb.cpp Index: secretarea_trigger.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- secretarea_trigger.h 24 Nov 2004 03:42:58 -0000 1.3 +++ secretarea_trigger.h 24 Nov 2004 17:33:50 -0000 1.4 @@ -8,8 +8,6 @@ #include "app/globals.h" #include "timer.h" -#define MESSAGE_TIME 3 - class SecretAreaTrigger : public TriggerBase, public Serializable { public: Index: secretarea_trigger.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- secretarea_trigger.cpp 24 Nov 2004 03:42:58 -0000 1.3 +++ secretarea_trigger.cpp 24 Nov 2004 17:33:50 -0000 1.4 @@ -4,6 +4,8 @@ #include "utils/lispwriter.h" #include "gameloop.h" +#define MESSAGE_TIME 3 + SecretAreaTrigger::SecretAreaTrigger(LispReader& reader) { reader.read_float("x", bbox.p1.x); |
From: Marek M. <wa...@us...> - 2004-11-24 17:34:04
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1377/data/levels/test Modified Files: bonusblock.stl Log Message: added simple enemy dispenser (can only dispense bouncing snowballs so far and looks like a snowball) it's in data/test/bonusblocks.stl, right behind the secret area ;-) fixed typo(?) in mrbomb.cpp Index: bonusblock.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/bonusblock.stl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- bonusblock.stl 24 Nov 2004 14:10:19 -0000 1.4 +++ bonusblock.stl 24 Nov 2004 17:33:49 -0000 1.5 @@ -9,7 +9,8 @@ (gravity 10.000000) (background (image "arctis.jpg") (speed 0.5)) - (secretarea (x 128) (y 128) (message "You found a secret area!")) + (secretarea (x 400) (y 128) (message "You found a secret area!")) + (dispenser (x 500) (y 128) (badguy "snowball")) (spawn-points (name "main") (x 100) |