17 #ifndef HEADER_SUPERTUX_OBJECT_EXPLOSION_HPP 18 #define HEADER_SUPERTUX_OBJECT_EXPLOSION_HPP 20 #include "object/moving_sprite.hpp" 22 #define EXPLOSION_STRENGTH_DEFAULT (1464.8f * 32.0f * 32.0f) 23 #define EXPLOSION_STRENGTH_NEAR (1000.f * 32.0f * 32.0f) 30 Explosion(
const Vector& pos,
float push_strength,
int num_particles=100,
bool short_fuse =
false);
33 static std::string class_name() {
return "explosion"; }
34 virtual std::string get_class_name()
const override {
return class_name(); }
35 static std::string display_name() {
return _(
"Explosion"); }
39 virtual void update(
float dt_sec)
override;
44 bool hurts()
const {
return hurt; }
45 void hurts (
bool val) { hurt = val; }
62 SpritePtr lightsprite;
Just your average explosion - goes boom, hurts Tux.
Definition: explosion.hpp:26
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: explosion.cpp:152
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: explosion.cpp:174
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: explosion.hpp:36
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_sprite.hpp:60
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: explosion.cpp:167
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: explosion.hpp:37
Explosion(const Vector &pos, float push_strength, int num_particles=100, bool short_fuse=false)
Create new Explosion centered(!) at pos.
Definition: explosion.cpp:34
A helper structure to list all the type_indexes of the classes in the type hierarchy of a given class...
Definition: game_object.hpp:57
Definition: reader_mapping.hpp:32
Abstract base class for ""MovingObject""s, that are represented by a sprite.
Definition: moving_sprite.hpp:33
virtual bool is_saveable() const override
Indicates if the object will be saved.
Definition: explosion.hpp:42
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class collects data about a collision.
Definition: collision_hit.hpp:44