#303: Typo fixes from mathnerd314
[supertux.git] / src / object / ambient_sound.hpp
index 9adf724..dd5c9da 100644 (file)
@@ -21,7 +21,7 @@
 /**
  *  Ambient Sound Source, gamma version. Features:
  *
- *  - "rounded rectancle" geometry with position, dimension and
+ *  - "rounded rectangle" geometry with position, dimension and
  *    "rounding radius" (extending in all directions) of a 100%
  *    volume area, adjustable maximum volume, inverse square
  *    falloff outside area.
@@ -32,7 +32,7 @@
  *
  *    x, y               position
  *    width, height      dimension
- *    distance_factor    high = steep fallofff
+ *    distance_factor    high = steep falloff
  *    distance_bias      high = big "100% disc"
  *    silence_distance   defaults reasonably.
  *    sample             sample to be played back in loop mode
@@ -43,7 +43,7 @@
 #ifndef __AMBIENT_SOUND_H__
 #define __AMBIENT_SOUND_H__
 
-#include "moving_object.hpp"
+#include "game_object.hpp"
 #include "resources.hpp"
 #include "player.hpp"
 #include "script_interface.hpp"
 
 class SoundSource;
 
-class AmbientSound : public MovingObject, public ScriptInterface, public Scripting::AmbientSound
+class AmbientSound : public GameObject, public ScriptInterface, public Scripting::AmbientSound
 {
 public:
   AmbientSound(const lisp::Lisp& lisp);
   AmbientSound(Vector pos, float factor, float bias, float vol, std::string file);
   ~AmbientSound();
 
-  /*void set_pos(Vector newpos)
+  void set_pos(Vector newpos)
   {
     position=newpos;
   }
-  const Vector &get_pos() const
+  const Vector get_pos() const
   {
-    return get_pos();
-  }*/
-
-  // --- BEGIN METHODS TO EXPOSE TO SQUIRREL --- //
-  void set_pos(float x, float y)
-  {
-    MovingObject::set_pos(x, y);
+    return position;
   }
 
-  float get_pos_x() const
-  {
-    return MovingObject::get_pos_x();
-  }
-
-  float get_pos_y() const
-  {
-    return MovingObject::get_pos_y();
-  }
-  // --- END METHODS TO EXPOSE TO SQUIRREL --- //
-
-  HitResponse collision(GameObject&, const CollisionHit&)
-  {
-    return ABORT_MOVE;
-  }
+  /**
+   * @name Scriptable Methods
+   * @{
+   */
+  void set_pos(float x, float y);
+  float get_pos_x() const;
+  float get_pos_y() const;
+  /**
+   * @}
+   */
 
 protected:
   virtual void hit(Player& player);
@@ -98,6 +87,10 @@ protected:
   virtual void expose(HSQUIRRELVM vm, SQInteger table_idx);
   virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
 private:
+  std::string name; /**< user-defined name for use in scripts or empty string if not scriptable */
+  Vector position;
+  Vector dimension;
+
   std::string sample;
   SoundSource* sound_source;
   int latency;