| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "../Enemies/EnemyBase.h" |
| 4 |
|
| 5 |
namespace Jazz2::Actors::Solid |
| 6 |
{ |
| 7 |
/** @brief Spike ball */ |
| 8 |
class SpikeBall : public Enemies::EnemyBase |
| 9 |
{ |
| 10 |
DEATH_RUNTIME_OBJECT(Enemies::EnemyBase); |
| 11 |
|
| 12 |
public: |
| 13 |
SpikeBall(); |
| 14 |
|
| 15 |
static void Preload(const ActorActivationDetails& details); |
| 16 |
|
| 17 |
protected: |
| 18 |
Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override; |
| 19 |
void OnUpdate(float timeMult) override; |
| 20 |
void OnUpdateHitbox() override; |
| 21 |
bool OnDraw(RenderQueue& renderQueue) override; |
| 22 |
|
| 23 |
private: |
| 24 |
#ifndef DOXYGEN_GENERATING_OUTPUT |
| 25 |
// Doxygen 1.12.0 outputs also private structs/unions even if it shouldn't |
| 26 |
struct ChainPiece { |
| 27 |
Vector2f Pos; |
| 28 |
float Scale; |
| 29 |
std::unique_ptr<RenderCommand> Command; |
| 30 |
}; |
| 31 |
#endif |
| 32 |
|
| 33 |
bool _shade; |
| 34 |
float _speed; |
| 35 |
bool _isSwing; |
| 36 |
float _phase; |
| 37 |
Vector2f _originPos; |
| 38 |
std::uint16_t _originLayer; |
| 39 |
|
| 40 |
SmallVector<ChainPiece, 0> _pieces; |
| 41 |
|
| 42 |
Vector2f GetPhasePosition(std::int32_t distance, float* scale); |
| 43 |
}; |
| 44 |
} |