Bomberman-OverlordEngine-x64 / BombermanGame / Prefabs / Bomberman / Bomb.h
Bomb.h
Raw
#pragma once

class DiffuseAnimatedMaterial;

class Bomb : public GameObject
{
public:
	Bomb(GameObject* pPlayer, const XMFLOAT3& startPos, const XMFLOAT4& cameraRot, int power = 1);
	~Bomb() override = default;

	Bomb(const Bomb& other) = delete;
	Bomb(Bomb&& other) noexcept = delete;
	Bomb& operator=(const Bomb& other) = delete;
	Bomb& operator=(Bomb&& other) noexcept = delete;

	void DrawImGui();

protected:
	void Initialize(const SceneContext&) override;
	void Update(const SceneContext&) override;

	void Explode(const SceneContext&);

private:

	static PxMaterial* m_pPxMaterial;
	static std::vector<UINT> m_MaterialIds;
	DiffuseAnimatedMaterial* m_pAnimatedMaterial;
	DiffuseAnimatedMaterial* m_pAnimatedMaterial2;
	DiffuseAnimatedMaterial* m_pAnimatedMaterial3;

	GameObject* m_pPlayer;

	static int m_Count;
	const float m_Amplitude{ 0.05f };
	const float m_Frequency{ 2.5f };

	GameObject* m_ModelsContainer{ nullptr };
	std::vector<GameObject*> m_pExplosionLines{};
	std::vector<GameObject*> m_pExplosionBase{};
	std::vector<GameObject*> m_pExplosionEnds{};

	int m_Power;

	RigidBodyComponent* m_pActor{ nullptr };

	GameObject* m_pShadow{ nullptr };
	GameObject* m_pBase{ nullptr };
	GameObject* m_pFuse{ nullptr };

	GameObject* m_pFlash{ nullptr };

	XMFLOAT3 m_StartPos;
	XMFLOAT4 m_BaseRotation;
	float m_ScaleStep{};

	float m_SquishTimer{};
	float m_SquishDuration{ 0.333f };
	float m_Lifetime{ 3.f };
	float m_ExplosionTime{ 0.5f };
};