SuperTuxKart
Loading...
Searching...
No Matches
bowling.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2007-2015 Joerg Henrichs, Marianne Gagnon
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_BOWLING_HPP
20#define HEADER_BOWLING_HPP
21
22namespace irr
23{
24 namespace scene { class IMesh; }
25}
26#include <irrString.h>
27using namespace irr;
28
29#include "items/flyable.hpp"
30
31class XMLNode;
32class SFXBase;
33
37class Bowling : public Flyable
38{
39private:
40 static float m_st_max_distance; // maximum distance for a bowling ball to be attracted
41 static float m_st_max_distance_squared;
42 static float m_st_force_to_target;
43
48
51 void removeRollSfx();
52
53public:
54 Bowling(AbstractKart* kart);
55 virtual ~Bowling();
56 static void init(const XMLNode &node, scene::IMesh *bowling);
57 virtual bool updateAndDelete(int ticks) OVERRIDE;
58 virtual bool hit(AbstractKart* kart, PhysicalObject* obj=NULL) OVERRIDE;
59 virtual HitEffect *getHitEffect() const OVERRIDE;
60 // ------------------------------------------------------------------------
61 virtual void onFireFlyable() OVERRIDE;
62
63}; // Bowling
64
65#endif
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Definition: bowling.hpp:38
virtual void onFireFlyable() OVERRIDE
Call when the item is (re-)fired (during rewind if needed) by projectile_manager.
Definition: bowling.cpp:201
virtual bool updateAndDelete(int ticks) OVERRIDE
Updates the bowling ball ineach frame.
Definition: bowling.cpp:79
virtual HitEffect * getHitEffect() const OVERRIDE
Returns the hit effect object to use when this objects hits something.
Definition: bowling.cpp:188
bool m_has_hit_kart
If a bowling ball has hit something, this flag is set to indicate if a kart was hit or not.
Definition: bowling.hpp:47
virtual bool hit(AbstractKart *kart, PhysicalObject *obj=NULL) OVERRIDE
Callback from the physics in case that a kart or physical object is hit.
Definition: bowling.cpp:155
SFXBase * m_roll_sfx
A sound effect for rolling ball.
Definition: bowling.hpp:50
static void init(const XMLNode &node, scene::IMesh *bowling)
Initialises this object with data from the power.xml file.
Definition: bowling.cpp:60
virtual ~Bowling()
Destructor, removes any playing sfx.
Definition: bowling.cpp:49
Definition: flyable.hpp:50
A small interface for effects to be used when a kart is hit.
Definition: hit_effect.hpp:33
Definition: physical_object.hpp:40
The base class for sound effects.
Definition: sfx_base.hpp:43
utility class used to parse XML files
Definition: xml_node.hpp:48