-// ambient_sound.h basti_
-//
+// $Id$
+//
// SuperTux
+// 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.
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
/**
* Ambient Sound Source, gamma version. Features:
#include "game_object.hpp"
#include "resources.hpp"
#include "player.hpp"
+#include "script_interface.hpp"
+#include "scripting/ambient_sound.hpp"
class SoundSource;
-class AmbientSound : public GameObject
+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)
+ {
+ position=newpos;
+ }
+ const Vector get_pos() const
+ {
+ return position;
+ }
+
+ // --- Scripting Interface ---
+
+ void set_pos(float x, float y);
+ float get_pos_x();
+ float get_pos_y();
+
protected:
virtual void hit(Player& player);
virtual void update(float time);
virtual void draw(DrawingContext&);
virtual void start_playing();
virtual void stop_playing();
+ 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;