Add sound to swatter
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9542 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
753ef5c351
commit
4112aee9a3
@ -50,7 +50,7 @@
|
|||||||
w-multi=" 0 20 20 20 20 0 0 5 5 0" />
|
w-multi=" 0 20 20 20 20 0 0 5 5 0" />
|
||||||
<end33 w=" 0 30 30 30 30 10 20 30 30 30"
|
<end33 w=" 0 30 30 30 30 10 20 30 30 30"
|
||||||
w-multi=" 0 30 30 30 30 0 0 20 20 0" />
|
w-multi=" 0 30 30 30 30 0 0 20 20 0" />
|
||||||
<last w=" 0 30 30 60 60 0 0 60 60 60"
|
<last w=" 0 30 30 60 60 0 40 60 60 60"
|
||||||
w-multi=" 0 30 30 60 60 0 0 0 0 0" />
|
w-multi=" 0 30 30 60 60 0 0 0 0 0" />
|
||||||
<battle w=" 0 30 60 0 0 10 30 0 0 0"
|
<battle w=" 0 30 60 0 0 10 30 0 0 0"
|
||||||
w-multi=" 0 0 5 0 0 0 0 0 0 0" />
|
w-multi=" 0 0 5 0 0 0 0 0 0 0" />
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
#include "items/swatter.hpp"
|
#include "items/swatter.hpp"
|
||||||
|
|
||||||
#include "audio/music_manager.hpp"
|
#include "audio/music_manager.hpp"
|
||||||
|
#include "audio/sfx_base.hpp"
|
||||||
|
#include "audio/sfx_manager.hpp"
|
||||||
#include "items/attachment.hpp"
|
#include "items/attachment.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
#include "karts/kart.hpp"
|
#include "karts/kart.hpp"
|
||||||
@ -48,6 +50,8 @@ Swatter::Swatter(Attachment *attachment, Kart *kart)
|
|||||||
scene::IAnimatedMeshSceneNode* node = m_attachment->getNode();
|
scene::IAnimatedMeshSceneNode* node = m_attachment->getNode();
|
||||||
node->setPosition(SWAT_POS_OFFSET);
|
node->setPosition(SWAT_POS_OFFSET);
|
||||||
node->setAnimationSpeed(0);
|
node->setAnimationSpeed(0);
|
||||||
|
|
||||||
|
m_swat_sound = sfx_manager->createSoundSource("swatter");
|
||||||
} // Swatter
|
} // Swatter
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -179,6 +183,9 @@ void Swatter::squashThingsAround()
|
|||||||
assert(swatter_node);
|
assert(swatter_node);
|
||||||
Vec3 swatter_pos = swatter_node->getAbsolutePosition();
|
Vec3 swatter_pos = swatter_node->getAbsolutePosition();
|
||||||
|
|
||||||
|
m_swat_sound->position(swatter_pos);
|
||||||
|
m_swat_sound->play();
|
||||||
|
|
||||||
// Squash karts around
|
// Squash karts around
|
||||||
for(unsigned int i=0; i<world->getNumKarts(); i++)
|
for(unsigned int i=0; i<world->getNumKarts(); i++)
|
||||||
{
|
{
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
class Kart;
|
class Kart;
|
||||||
class Item;
|
class Item;
|
||||||
class Attachment;
|
class Attachment;
|
||||||
|
class SFXBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \ingroup items
|
* \ingroup items
|
||||||
@ -50,6 +51,8 @@ private:
|
|||||||
/** The kart the swatter is aiming at. */
|
/** The kart the swatter is aiming at. */
|
||||||
Moveable *m_target;
|
Moveable *m_target;
|
||||||
|
|
||||||
|
SFXBase *m_swat_sound;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Swatter(Attachment *attachment, Kart *kart);
|
Swatter(Attachment *attachment, Kart *kart);
|
||||||
virtual ~Swatter();
|
virtual ~Swatter();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user