This repository has been archived on 2023-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
mipt_cpp/seminar13_polymorphism/arkanoid/bonus.hpp

28 lines
671 B
C++
Raw Normal View History

2023-01-04 14:37:54 +03:00
#pragma once
2023-01-04 14:56:03 +03:00
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
class Paddle;
class Ball;
2023-01-04 14:37:54 +03:00
class Arkanoid;
2023-01-04 13:46:41 +03:00
class Bonus
{
private:
inline static const float speed = 120;
inline static const float radius = 15;
sf::Vector2f m_position;
float m_time;
public:
Bonus(sf::Vector2f position);
void update(float dt);
void draw(sf::RenderWindow& window) const;
void activate(Arkanoid& game);
bool isColiding(const Paddle& paddle) const;
// Класс Arkanoid должен быть дружественным, так как он может менять внутреннее объекта-бонуса
friend class Arkanoid;
};