Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12572
Modified Files:
badguy.cpp badguy.h level.cpp leveleditor.cpp world.cpp
world.h
Log Message:
- added stay-on-platform into the level fileformat
Index: world.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/world.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- world.h 20 Apr 2004 19:55:23 -0000 1.26
+++ world.h 20 Apr 2004 20:10:53 -0000 1.27
@@ -86,7 +86,7 @@
void add_broken_brick(Tile* tile, float x, float y);
void add_broken_brick_piece(Tile* tile, float x, float y, float xm, float ym);
void add_bouncy_brick(float x, float y);
- void add_bad_guy(float x, float y, BadGuyKind kind);
+ void add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform = false);
void add_upgrade(float x, float y, Direction dir, UpgradeKind kind);
void add_bullet(float x, float y, float xm, Direction dir);
Index: leveleditor.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- leveleditor.cpp 20 Apr 2004 19:55:03 -0000 1.60
+++ leveleditor.cpp 20 Apr 2004 20:10:49 -0000 1.61
@@ -95,7 +95,7 @@
bad_guys.push_back(BadGuy());
BadGuy& new_bad_guy = bad_guys.back();
- new_bad_guy.init(x,y,kind);
+ new_bad_guy.init(x,y,kind, false /* stay_on_platform */);
}
void activate_bad_guys()
Index: badguy.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- badguy.h 20 Apr 2004 19:55:02 -0000 1.29
+++ badguy.h 20 Apr 2004 20:10:47 -0000 1.30
@@ -124,7 +124,7 @@
float animation_speed;
public:
- void init(float x, float y, BadGuyKind kind);
+ void init(float x, float y, BadGuyKind kind, bool stay_on_platform);
void action(float frame_ratio);
void draw();
Index: badguy.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- badguy.cpp 20 Apr 2004 18:39:17 -0000 1.39
+++ badguy.cpp 20 Apr 2004 20:10:26 -0000 1.40
@@ -144,7 +144,7 @@
}
void
-BadGuy::init(float x, float y, BadGuyKind kind_)
+BadGuy::init(float x, float y, BadGuyKind kind_, bool stay_on_platform_)
{
base.x = x;
base.y = y;
@@ -153,7 +153,7 @@
base.xm = 0;
base.ym = 0;
- stay_on_platform = false;
+ stay_on_platform = stay_on_platform_;
mode = NORMAL;
dying = DYING_NOT;
kind = kind_;
Index: level.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- level.cpp 20 Apr 2004 19:55:02 -0000 1.42
+++ level.cpp 20 Apr 2004 20:10:48 -0000 1.43
@@ -358,6 +358,7 @@
LispReader reader(lisp_cdr(data));
reader.read_int("x", &bg_data.x);
reader.read_int("y", &bg_data.y);
+ reader.read_bool("stay-on-platform", &bg_data.stay_on_platform);
badguy_data.push_back(bg_data);
@@ -572,7 +573,9 @@
for(std::vector<BadGuyData>::iterator it = badguy_data.begin();
it != badguy_data.end();
++it)
- fprintf( fi,"(%s (x %d) (y %d))\n",badguykind_to_string((*it).kind).c_str(),(*it).x,(*it).y);
+ fprintf( fi,"(%s (x %d) (y %d) (stay-on-platform %s))\n",
+ badguykind_to_string((*it).kind).c_str(),(*it).x,(*it).y,
+ it->stay_on_platform ? "#t" : "#f");
fprintf( fi,")\n");
Index: world.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- world.cpp 20 Apr 2004 19:55:11 -0000 1.32
+++ world.cpp 20 Apr 2004 20:10:52 -0000 1.33
@@ -97,7 +97,7 @@
i != level->badguy_data.end();
++i)
{
- add_bad_guy(i->x, i->y, i->kind);
+ add_bad_guy(i->x, i->y, i->kind, i->stay_on_platform);
}
}
@@ -380,12 +380,12 @@
}
void
-World::add_bad_guy(float x, float y, BadGuyKind kind)
+World::add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform)
{
bad_guys.push_back(BadGuy());
BadGuy& new_bad_guy = bad_guys.back();
- new_bad_guy.init(x,y,kind);
+ new_bad_guy.init(x,y,kind, stay_on_platform);
}
void
|