[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs fake_exit.cxx,1.2,1.3
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs fake_exit.cxx,1.2,1.3 |
Date: |
10 Sep 2002 15:36:46 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv27925/worldobjs
Modified Files:
fake_exit.cxx
Log Message:
- fixed bug in the trap writing
- fixed fakeexit position bug
- fixed bug in resource modifier
Index: fake_exit.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/fake_exit.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fake_exit.cxx 5 Sep 2002 11:26:35 -0000 1.2
+++ fake_exit.cxx 10 Sep 2002 15:36:44 -0000 1.3
@@ -26,68 +26,71 @@
namespace WorldObjs {
- FakeExit::FakeExit (WorldObjsData::FakeExitData* data_) : smashing(false),
- data (new
WorldObjsData::FakeExitData(*data_))
- {
- data->counter.set_size(data->surface.get_num_frames());
- data->counter.set_type(GameCounter::once);
- data->counter.set_speed(2.5);
- data->counter = data->surface.get_num_frames() - 1;
- }
+FakeExit::FakeExit (WorldObjsData::FakeExitData* data_)
+ : smashing(false),
+ data (new WorldObjsData::FakeExitData(*data_))
+{
+ data->counter.set_size(data->surface.get_num_frames());
+ data->counter.set_type(GameCounter::once);
+ data->counter.set_speed(2.5);
+ data->counter = data->surface.get_num_frames() - 1;
- FakeExit::~FakeExit()
- {
- delete data;
- }
+ data->pos -= CL_Vector(data->surface.get_width ()/2,
data->surface.get_height ());
+}
- float
- FakeExit::get_z_pos () const
- {
- return data->pos.z;
- }
+FakeExit::~FakeExit()
+{
+ delete data;
+}
- void
- FakeExit::draw (GraphicContext& gc)
- {
- gc.draw (data->surface, data->pos, data->counter.value());
- }
+float
+FakeExit::get_z_pos () const
+{
+ return data->pos.z;
+}
+void
+FakeExit::draw (GraphicContext& gc)
+{
+ gc.draw (data->surface, data->pos, data->counter.value());
+}
- void
- FakeExit::update (float delta)
- {
- PinguHolder* holder = world->get_pingu_p ();
- for (PinguIter pingu = holder->begin (); pingu != holder->end (); ++pingu){
- catch_pingu(*pingu);
- }
- if (smashing)
- ++data->counter;
-
- UNUSED_ARG(delta);
+void
+FakeExit::update (float delta)
+{
+ PinguHolder* holder = world->get_pingu_p ();
+ for (PinguIter pingu = holder->begin (); pingu != holder->end (); ++pingu){
+ catch_pingu(*pingu);
}
- void
- FakeExit::catch_pingu (Pingu* pingu)
- {
- if (data->counter.finished()) {
- smashing = false;
- }
+ if (smashing)
+ ++data->counter;
+
+ UNUSED_ARG(delta);
+}
- if ( pingu->get_x() > data->pos.x + 31 && pingu->get_x() < data->pos.x +
31 + 15
- && pingu->get_y() > data->pos.y + 56 && pingu->get_y() < data->pos.y +
56 + 56)
- {
- if (!smashing) {
- data->counter = 0;
- smashing = true;
- }
+void
+FakeExit::catch_pingu (Pingu* pingu)
+{
+ if (data->counter.finished()) {
+ smashing = false;
+ }
- if (data->counter >= 3 && data->counter <= 5) {
- pingu->set_action(Actions::Smashed);
- }
+ if ( pingu->get_x() > data->pos.x + 31 && pingu->get_x() < data->pos.x +
31 + 15
+ && pingu->get_y() > data->pos.y + 56 && pingu->get_y() < data->pos.y +
56 + 56)
+ {
+ if (!smashing) {
+ data->counter = 0;
+ smashing = true;
}
- }
+ if (data->counter >= 3 && data->counter <= 5) {
+ pingu->set_action(Actions::Smashed);
+ }
+ }
}
+
+} // namespace WorldObjs
/* EOF */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldobjs fake_exit.cxx,1.2,1.3,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx,1.14,1.15
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata bumper_data.cxx,1.1,1.2 fake_exit_data.cxx,1.1,1.2 guillotine_data.cxx,1.1,1.2 hammer_data.cxx,1.1,1.2 laser_exit_data.cxx,1.1,1.2 smasher_data.cxx,1.2,1.3 spike_data.cxx,1.1,1.2
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx,1.14,1.15
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata bumper_data.cxx,1.1,1.2 fake_exit_data.cxx,1.1,1.2 guillotine_data.cxx,1.1,1.2 hammer_data.cxx,1.1,1.2 laser_exit_data.cxx,1.1,1.2 smasher_data.cxx,1.2,1.3 spike_data.cxx,1.1,1.2
- Index(es):