// $Id$
//
// Dart - Your average poison dart
-// Copyright (C) 2006 Christoph Sommer <supertux@2006.expires.deltadevelopment.de>
+// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Dart::Dart(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/dart/dart.sprite"), parent(0)
{
- physic.gravity_enabled = false;
+ physic.enable_gravity(false);
countMe = false;
sound_manager->preload("sounds/darthit.wav");
sound_manager->preload("sounds/stomp.wav");
Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0)
: BadGuy(pos, d, "images/creatures/dart/dart.sprite"), parent(parent)
{
- physic.gravity_enabled = false;
+ physic.enable_gravity(false);
countMe = false;
sound_manager->preload("sounds/darthit.wav");
sound_manager->preload("sounds/stomp.wav");
}
void
-Dart::activate()
+Dart::initialize()
{
- physic.vx = (dir == LEFT ? -::SPEED : ::SPEED);
+ physic.set_velocity_x(dir == LEFT ? -::SPEED : ::SPEED);
sprite->set_action(dir == LEFT ? "flying-left" : "flying-right");
+}
+void
+Dart::activate()
+{
sound_source.reset(sound_manager->create_sound_source(SOUNDFILE));
sound_source->set_position(get_pos());
sound_source->set_looping(true);