SuperTuxKart
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 
22 namespace irr
23 {
24  namespace scene { class IMesh; }
25 }
26 #include <irrString.h>
27 using namespace irr;
28 
29 #include "items/flyable.hpp"
30 
31 class XMLNode;
32 class SFXBase;
33 
37 class Bowling : public Flyable
38 {
39 private:
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 
53 public:
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
A small interface for effects to be used when a kart is hit.
Definition: hit_effect.hpp:32
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
Definition: bowling.hpp:37
Definition: physical_object.hpp:40
SFXBase * m_roll_sfx
A sound effect for rolling ball.
Definition: bowling.hpp:50
utility class used to parse XML files
Definition: xml_node.hpp:47
The base class for sound effects.
Definition: sfx_base.hpp:42
Definition: flyable.hpp:47
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:61