CCIMXDesktop
 
Loading...
Searching...
No Matches
Obsticals.h
1#ifndef OBSTICALS_H
2#define OBSTICALS_H
3
4#include "figure/FigureObject.h"
6
7class QMutex;
8class Dinasour;
10
15class Obsticals : public FigureObject {
16 Q_OBJECT
18
19public:
24 explicit Obsticals(QObject* parent = nullptr);
25
29 virtual ~Obsticals() = default;
30
36 virtual bool is_intersect(Dinasour* dinasour);
37
42 int get_moving_speed() const { return moving_speed; }
43
47 virtual void update_position();
48
53 virtual QRect& provide_current_bounding_rect() = 0;
54
59 virtual QPixmap& provide_drawing_srcframe() = 0;
60
61signals:
66
71 void speedChanged(int newSpeed);
72
73public slots:
78 virtual void set_moving_speed(const int speed);
79
80protected:
81 std::shared_ptr<QMutex> mutex;
82 int moving_speed { Settings::Scene::Difficulty::DEF_SPEED };
83};
84
85#endif // OBSTICALS_H
Frame fetcher for cactus-type obstacles.
Definition FigureFrameFetcher.h:88
Abstract base class for all drawable game objects.
Definition FigureObject.h:10
Base class for all obstacle objects in the game.
Definition Obsticals.h:15
virtual ~Obsticals()=default
Default virtual destructor.
void speedChanged(int newSpeed)
Emitted when speed changes.
virtual bool is_intersect(Dinasour *dinasour)
Checks collision with dinosaur.
Definition Obsticals.cpp:10
virtual void set_moving_speed(const int speed)
Sets moving speed.
Definition Obsticals.cpp:15
int moving_speed
Current movement speed.
Definition Obsticals.h:17
virtual QPixmap & provide_drawing_srcframe()=0
Provides drawing frame (pure virtual)
std::shared_ptr< QMutex > mutex
Mutex for thread safety.
Definition Obsticals.h:81
virtual QRect & provide_current_bounding_rect()=0
Provides collision bounding rectangle (pure virtual)
virtual void update_position()
Updates obstacle position.
Definition Obsticals.cpp:23
void pass_me_already()
Emitted when obstacle passes out of view.
int get_moving_speed() const
Gets current moving speed.
Definition Obsticals.h:42
Configuration constants related to the dinosaur figure.
Defines constants and settings related to the game scene and its behavior.