17 #ifndef HEADER_SUPERTUX_OBJECT_BULLET_HPP 18 #define HEADER_SUPERTUX_OBJECT_BULLET_HPP 20 #include "sprite/sprite_ptr.hpp" 21 #include "supertux/direction.hpp" 22 #include "supertux/moving_object.hpp" 23 #include "supertux/physic.hpp" 24 #include "supertux/player_status.hpp" 25 #include "video/layer.hpp" 32 Bullet(
const Vector& pos,
const Vector& xm, Direction dir, BonusType type,
Player& player);
36 virtual void update(
float dt_sec)
override;
42 virtual int get_layer()
const override {
return LAYER_OBJECTS; }
50 BonusType get_type()
const {
return type; }
52 Player& get_player()
const {
return m_player; }
59 SpritePtr lightsprite;
Definition: bullet.hpp:29
Physics engine.
Definition: physic.hpp:27
virtual void collision_solid(const CollisionHit &hit) override
this function is called when the object collided with something solid
Definition: bullet.cpp:103
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: bullet.cpp:124
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
void ricochet(GameObject &other, const CollisionHit &hit)
Makes bullet bounce off an object (that got hit).
Definition: bullet.cpp:118
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:35
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: bullet.cpp:94
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: bullet.cpp:61
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_object.hpp:49
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
virtual bool is_saveable() const override
Indicates if the object will be saved.
Definition: bullet.hpp:40
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: bullet.hpp:34
This module contains methods controlling the player.
Definition: player.hpp:47
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