2007-12-08 13:22:05 +00:00
|
|
|
//
|
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
2008-07-28 00:34:45 +00:00
|
|
|
// Copyright (C) 2007 Joerg Henrichs, Marianne Gagnon
|
2007-12-08 13:22:05 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-06-13 00:53:52 +00:00
|
|
|
// as published by the Free Software Foundation; either version 3
|
2007-12-08 13:22:05 +00:00
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// 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.
|
|
|
|
|
2009-03-12 00:57:00 +00:00
|
|
|
#ifndef HEADER_BOWLING_HPP
|
|
|
|
#define HEADER_BOWLING_HPP
|
|
|
|
|
2011-05-22 18:03:28 +00:00
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene { class IMesh; }
|
|
|
|
}
|
2011-08-25 22:02:29 +00:00
|
|
|
#include <irrString.h>
|
2009-03-12 00:57:00 +00:00
|
|
|
using namespace irr;
|
2007-12-08 13:22:05 +00:00
|
|
|
|
2009-06-11 10:00:43 +00:00
|
|
|
#include "items/flyable.hpp"
|
2007-12-08 13:22:05 +00:00
|
|
|
|
2010-02-07 02:05:21 +00:00
|
|
|
class XMLNode;
|
|
|
|
|
2010-04-23 20:36:13 +00:00
|
|
|
/**
|
|
|
|
* \ingroup items
|
|
|
|
*/
|
2008-07-28 00:34:45 +00:00
|
|
|
class Bowling : public Flyable
|
2007-12-08 13:22:05 +00:00
|
|
|
{
|
|
|
|
private:
|
2008-07-28 00:34:45 +00:00
|
|
|
static float m_st_max_distance; // maximum distance for a bowling ball to be attracted
|
2008-08-06 00:53:40 +00:00
|
|
|
static float m_st_max_distance_squared;
|
2007-12-08 13:22:05 +00:00
|
|
|
static float m_st_force_to_target;
|
2008-08-06 00:53:40 +00:00
|
|
|
|
2007-12-08 13:22:05 +00:00
|
|
|
public:
|
2012-03-19 20:21:11 +00:00
|
|
|
Bowling(AbstractKart* kart);
|
2010-02-07 02:05:21 +00:00
|
|
|
static void init(const XMLNode &node, scene::IMesh *bowling);
|
2011-08-25 00:06:33 +00:00
|
|
|
virtual bool updateAndDelete(float dt);
|
2012-03-19 20:21:11 +00:00
|
|
|
virtual const core::stringw getHitString(const AbstractKart *kart) const;
|
|
|
|
virtual bool hit(AbstractKart* kart, PhysicalObject* obj=NULL);
|
2011-08-25 22:02:29 +00:00
|
|
|
|
|
|
|
/** Returns the sfx to use when the bowling ball explodes. */
|
2011-04-23 00:22:16 +00:00
|
|
|
const char* getExplosionSound() const { return "strike"; }
|
2009-12-18 00:36:35 +00:00
|
|
|
|
2008-07-28 00:34:45 +00:00
|
|
|
}; // Bowling
|
2007-12-08 13:22:05 +00:00
|
|
|
|
|
|
|
#endif
|