changed worldmap to be stored inside the same directory as the levelsubset, fixed...
[supertux.git] / src / badguy / jumpy.cpp
index bc8dffe..6739a54 100644 (file)
@@ -17,22 +17,33 @@ Jumpy::write(lisp::Writer& writer)
 {
   writer.start_list("jumpy");
 
-  writer.write_float("x", get_pos().x);
-  writer.write_float("y", get_pos().y);
+  writer.write_float("x", start_position.x);
+  writer.write_float("y", start_position.y);
 
   writer.end_list("jumpy");
 }
 
 HitResponse
-Jumpy::collision_solid(GameObject& , const CollisionHit& hit)
+Jumpy::collision_solid(GameObject& , const CollisionHit& chit)
+{
+  return hit(chit);
+}
+
+HitResponse
+Jumpy::collision_badguy(BadGuy& , const CollisionHit& chit)
+{
+  return hit(chit);
+}
+
+HitResponse
+Jumpy::hit(const CollisionHit& chit)
 {
   // hit floor?
-  if(hit.normal.y < -.5) {
+  if(chit.normal.y < -.5) {
     physic.set_velocity_y(JUMPSPEED);
-  } else if(hit.normal.y < .5) { // bumped on roof
+  } else if(chit.normal.y < .5) { // bumped on roof
     physic.set_velocity_y(0);
   }
 
   return CONTINUE;
 }
-