[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2606 - in trunk: data/levels/volcano src/worldobjs
From: |
jave27 |
Subject: |
[Pingus-CVS] r2606 - in trunk: data/levels/volcano src/worldobjs |
Date: |
Wed, 18 Jan 2006 21:28:43 +0100 |
Author: jave27
Date: 2006-01-18 21:28:38 +0100 (Wed, 18 Jan 2006)
New Revision: 2606
Modified:
trunk/data/levels/volcano/hellmouth6-grumbel.pingus
trunk/src/worldobjs/spike.cxx
trunk/src/worldobjs/spike.hxx
Log:
Updated spike code to display again.
Found another bug that hides WorldObj's when they are layered... It's only
drawing the top Z position in some cases. Temporary fix: moved the spike in
that level to z=0.
Modified: trunk/data/levels/volcano/hellmouth6-grumbel.pingus
===================================================================
--- trunk/data/levels/volcano/hellmouth6-grumbel.pingus 2006-01-18 19:55:09 UTC
(rev 2605)
+++ trunk/data/levels/volcano/hellmouth6-grumbel.pingus 2006-01-18 20:28:38 UTC
(rev 2606)
@@ -53,35 +53,35 @@
<position>
<x>1030</x>
<y>76</y>
-<z>-100</z>
+<z>0</z>
</position>
</spike>
<spike>
<position>
<x>1032</x>
<y>136</y>
-<z>-100</z>
+<z>0</z>
</position>
</spike>
<spike>
<position>
<x>1032</x>
<y>107</y>
-<z>-100</z>
+<z>0</z>
</position>
</spike>
<spike>
<position>
<x>1034</x>
<y>167</y>
-<z>-100</z>
+<z>0</z>
</position>
</spike>
<spike>
<position>
<x>1036</x>
<y>198</y>
-<z>-100</z>
+<z>0</z>
</position>
</spike>
<hotspot>
@@ -106,7 +106,7 @@
<y>525</y>
<z>-50</z>
</position>
-<width>27</width>
+<width>1608</width>
<speed>50</speed>
</liquid>
<groundpiece>
Modified: trunk/src/worldobjs/spike.cxx
===================================================================
--- trunk/src/worldobjs/spike.cxx 2006-01-18 19:55:09 UTC (rev 2605)
+++ trunk/src/worldobjs/spike.cxx 2006-01-18 20:28:38 UTC (rev 2606)
@@ -32,10 +32,6 @@
killing(false)
{
reader.read_vector("position", pos);
- counter.set_size(surface.get_frame_count());
- counter.set_type(GameCounter::once);
- counter.set_speed(1);
- counter = 0;
}
float
@@ -48,7 +44,7 @@
Spike::draw (SceneContext& gc)
{
if (killing) {
- gc.color().draw (surface, pos, counter);
+ gc.color().draw (surface, pos);
} else {
// do nothing
}
@@ -57,38 +53,35 @@
void
Spike::update()
{
- if (killing)
- ++counter;
+ if (killing)
+ surface.update();
- PinguHolder* holder = world->get_pingus();
- for (PinguIter pingu = holder->begin (); pingu != holder->end (); ++pingu){
- catch_pingu(*pingu);
- }
-
- if (counter == static_cast<int>(surface.get_frame_count()) - 1) {
- killing = false;
- counter = 0;
- }
+ PinguHolder* holder = world->get_pingus();
+ for (PinguIter pingu = holder->begin (); pingu != holder->end ();
++pingu)
+ catch_pingu(*pingu);
+
+ if (surface.get_current_frame() == surface.get_frame_count() - 1)
+ killing = false;
}
void
Spike::catch_pingu (Pingu* pingu)
{
- if (!killing) {
- if ( pingu->get_x () > pos.x + 16 - 5 && pingu->get_x () < pos.x + 16 + 5
- && pingu->get_y () > pos.y && pingu->get_y () < pos.y + 32)
- {
- counter = 0;
- killing = true;
- }
- } else {
- if ( counter == 3
- && pingu->get_x () > pos.x +16 - 12 && pingu->get_x () < pos.x + 16
+ 12
- && pingu->get_y () > pos.y && pingu->get_y () < pos.y + 32)
- {
- pingu->set_status(PS_DEAD);
- }
- }
+ if (!killing) {
+ if (pingu->get_x () > pos.x + 16 - 5 && pingu->get_x () < pos.x
+ 16 + 5
+ && pingu->get_y () > pos.y && pingu->get_y ()
< pos.y + 32)
+ {
+ surface.restart();
+ killing = true;
+ }
+ } else {
+ if (surface.get_current_frame() == 3
+ && pingu->get_x () > pos.x +16 - 12 && pingu->get_x ()
< pos.x + 16 + 12
+ && pingu->get_y () > pos.y && pingu->get_y ()
< pos.y + 32)
+ {
+ pingu->set_status(PS_DEAD);
+ }
+ }
}
} // namespace WorldObjs
Modified: trunk/src/worldobjs/spike.hxx
===================================================================
--- trunk/src/worldobjs/spike.hxx 2006-01-18 19:55:09 UTC (rev 2605)
+++ trunk/src/worldobjs/spike.hxx 2006-01-18 20:28:38 UTC (rev 2606)
@@ -38,7 +38,6 @@
private:
CL_Sprite surface;
Vector pos;
- GameCounter counter;
bool killing;
public:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2606 - in trunk: data/levels/volcano src/worldobjs,
jave27 <=