| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "../ActorBase.h" |
| 4 |
|
| 5 |
namespace Jazz2::Actors::Environment |
| 6 |
{ |
| 7 |
/** @brief Swinging vine */ |
| 8 |
class SwingingVine : public ActorBase |
| 9 |
{ |
| 10 |
DEATH_RUNTIME_OBJECT(ActorBase); |
| 11 |
|
| 12 |
public: |
| 13 |
SwingingVine(); |
| 14 |
~SwingingVine(); |
| 15 |
|
| 16 |
bool OnHandleCollision(std::shared_ptr<ActorBase> other) override; |
| 17 |
|
| 18 |
static void Preload(const ActorActivationDetails& details); |
| 19 |
|
| 20 |
protected: |
| 21 |
Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override; |
| 22 |
void OnUpdate(float timeMult) override; |
| 23 |
void OnUpdateHitbox() override; |
| 24 |
bool OnDraw(RenderQueue& renderQueue) override; |
| 25 |
|
| 26 |
private: |
| 27 |
static constexpr std::int32_t ChunkCount = 16; |
| 28 |
static constexpr float ChunkSize = 136.0f / ChunkCount; |
| 29 |
|
| 30 |
float _angle; |
| 31 |
float _phase; |
| 32 |
bool _justTurned; |
| 33 |
Vector2f _chunkPos[ChunkCount]; |
| 34 |
std::unique_ptr<RenderCommand> _chunks[ChunkCount]; |
| 35 |
}; |
| 36 |
} |