Draw bouncy coin above other objects
[supertux.git] / src / object / particlesystem_interactive.cpp
index edb2cbc..b2f55ca 100644 (file)
@@ -1,7 +1,7 @@
-//  $Id: particlesystem.cpp 2470 2005-05-11 14:49:28Z wansti $
-// 
+//  $Id$
+//
 //  SuperTux
-//  Copyright (C) 2004 Matthias Braun <matze@braunis.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
 #include <config.h>
 
 #include <iostream>
@@ -45,7 +46,7 @@ ParticleSystem_Interactive::ParticleSystem_Interactive()
 {
     virtual_width = SCREEN_WIDTH;
     virtual_height = SCREEN_HEIGHT;
-    layer = LAYER_TILES;
+    z_pos = 0;
 }
 
 ParticleSystem_Interactive::~ParticleSystem_Interactive()
@@ -63,7 +64,7 @@ void ParticleSystem_Interactive::draw(DrawingContext& context)
     std::vector<Particle*>::iterator i;
     for(i = particles.begin(); i != particles.end(); ++i) {
         Particle* particle = *i;
-        context.draw_surface(particle->texture, particle->pos, layer);
+        context.draw_surface(particle->texture, particle->pos, z_pos);
     }
 
     context.pop_transform();
@@ -167,14 +168,14 @@ RainParticleSystem::RainParticleSystem()
 void
 RainParticleSystem::parse(const lisp::Lisp& reader)
 {
-  reader.get("layer", layer);
+  reader.get("z-pos", z_pos);
 }
 
 void
 RainParticleSystem::write(lisp::Writer& writer)
 {
   writer.start_list("particles-rain");
-  writer.write_int("layer", layer);
+  writer.write_int("z-pos", z_pos);
   writer.end_list("particles-rain");
 }
 
@@ -249,14 +250,14 @@ CometParticleSystem::CometParticleSystem()
 void
 CometParticleSystem::parse(const lisp::Lisp& reader)
 {
-  reader.get("layer", layer);
+  reader.get("z-pos", z_pos);
 }
 
 void
 CometParticleSystem::write(lisp::Writer& writer)
 {
   writer.start_list("particles-comets");
-  writer.write_int("layer", layer);
+  writer.write_int("z-pos", z_pos);
   writer.end_list("particles-comets");
 }