-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
597ebde
commit a73be57
Showing
10 changed files
with
240 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
//===================================== | ||
// | ||
//ボンバーファイア処理[BomberFire.cpp] | ||
//Author:GP12A332 21 立花雄太 | ||
// | ||
//===================================== | ||
#include "BomberFire.h" | ||
#include "Framework\Easing.h" | ||
|
||
/************************************** | ||
マクロ定義 | ||
***************************************/ | ||
|
||
/************************************** | ||
BomberFireコンストラクタ | ||
***************************************/ | ||
BomberFire::BomberFire() | ||
{ | ||
SetAnimParameter(&D3DXVECTOR2(8.0f, 8.0f)); | ||
|
||
moveDir.x = RandomRangef(-1.0f, 1.0f); | ||
moveDir.y = RandomRangef(-1.0f, 1.0f); | ||
moveDir.z = RandomRangef(0.5f, 5.0f); | ||
D3DXVec3Normalize(&moveDir, &moveDir); | ||
|
||
speed = RandomRangef(5.0f, 10.0f); | ||
|
||
lifeFrame = RandomRange(20, 40); | ||
} | ||
|
||
/************************************** | ||
BomberFire初期化処理 | ||
***************************************/ | ||
void BomberFire::Init() | ||
{ | ||
cntFrame = 0; | ||
active = true; | ||
} | ||
|
||
/************************************** | ||
BomberFire更新処理 | ||
***************************************/ | ||
void BomberFire::Update() | ||
{ | ||
cntFrame++; | ||
|
||
float t = (float)cntFrame / lifeFrame; | ||
float currentSpeed = Easing::EaseValue(t, speed, 0.0f, EaseType::InCubic); | ||
transform.pos += moveDir * currentSpeed; | ||
|
||
Animation(t); | ||
|
||
if (cntFrame == lifeFrame) | ||
{ | ||
active = false; | ||
} | ||
} | ||
|
||
/************************************** | ||
BomberFireEmitter初期化処理 | ||
***************************************/ | ||
void BomberFireEmitter::Init() | ||
{ | ||
cntFrame = 0; | ||
duration = 3; | ||
active = true; | ||
} | ||
|
||
/************************************** | ||
BomberFireEmitter更新処理 | ||
***************************************/ | ||
void BomberFireEmitter::Update() | ||
{ | ||
cntFrame++; | ||
|
||
if (cntFrame == duration) | ||
{ | ||
active = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//===================================== | ||
// | ||
//ボンバーファイアヘッダ[BomberFire.h] | ||
//Author:GP12B332 21 立花雄太 | ||
// | ||
//===================================== | ||
#ifndef _BOBMERFIRE_H_ | ||
#define _BOBMERFIRE_H_ | ||
|
||
#include "main.h" | ||
#include "Framework\AnimationParticle.h" | ||
#include "Framework\BaseEmitter.h" | ||
|
||
/************************************** | ||
マクロ定義 | ||
***************************************/ | ||
|
||
/************************************** | ||
BomberFireクラス | ||
***************************************/ | ||
class BomberFire : public AnimationParticle | ||
{ | ||
public: | ||
BomberFire(); | ||
|
||
void Init(); | ||
void Update(); | ||
|
||
private: | ||
D3DXVECTOR3 moveDir; | ||
float speed; | ||
}; | ||
|
||
/************************************** | ||
BomberFireEmitterクラス | ||
***************************************/ | ||
class BomberFireEmitter : public BaseEmitter | ||
{ | ||
public: | ||
void Init(); | ||
void Update(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//===================================== | ||
// | ||
//ボンバーファイアコントローラ処理[BomberFireController.cpp] | ||
//Author:GP12A332 21 立花雄太 | ||
// | ||
//===================================== | ||
#include "BomberFireController.h" | ||
#include "BomberFire.h" | ||
|
||
/************************************** | ||
マクロ定義 | ||
***************************************/ | ||
#define BOBMERFIRE_TEXTURE_NAME "data/TEXTURE/Effect/BomberFire.png" | ||
#define BOMBERFIRE_TEXTURE_DIV (&D3DXVECTOR2(8.0f, 8.0f)) | ||
#define BOMBERFIRE_SIZE (&D3DXVECTOR2(5.0f, 5.0f)) | ||
#define BOMBERFIRE_NUM_MAX (512) | ||
#define BOMBERFIRE_EMITTER_NUM (1) | ||
#define BOMBERFIRE_EMIT_NUM (170) | ||
|
||
/************************************** | ||
初期化処理 | ||
***************************************/ | ||
void BomberFireController::Init() | ||
{ | ||
//単位頂点バッファ作成、テクスチャロード | ||
MakeUnitBuffer(BOMBERFIRE_SIZE, BOMBERFIRE_TEXTURE_DIV); | ||
LoadTexture(BOBMERFIRE_TEXTURE_NAME); | ||
|
||
//パラメータコンテナ作成 | ||
particleContainer.resize(BOMBERFIRE_NUM_MAX); | ||
for (auto& particle : particleContainer) | ||
{ | ||
particle = new BomberFire(); | ||
} | ||
|
||
//エミッタコンテナ作成 | ||
emitterContainer.resize(BOMBERFIRE_EMITTER_NUM); | ||
for (auto& emitter : emitterContainer) | ||
{ | ||
emitter = new BomberFireEmitter(); | ||
} | ||
} | ||
|
||
/************************************** | ||
放出処理 | ||
***************************************/ | ||
void BomberFireController::Emit() | ||
{ | ||
ForEachEmitter(BOMBERFIRE_EMIT_NUM, [](BaseEmitter* emitter, BaseParticle* particle) | ||
{ | ||
particle->transform.pos = emitter->transform.pos; | ||
particle->Init(); | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//===================================== | ||
// | ||
//ボンバーファイアコントローラヘッダ[BomberFireController.h] | ||
//Author:GP12B332 21 立花雄太 | ||
// | ||
//===================================== | ||
#ifndef _BOMBERFIRECONTROLLER_H_ | ||
#define _BOMBERFIRECONTROLLER_H_ | ||
|
||
#include "main.h" | ||
#include "Framework\BaseParticleController.h" | ||
|
||
/************************************** | ||
マクロ定義 | ||
***************************************/ | ||
|
||
/************************************** | ||
クラス定義 | ||
***************************************/ | ||
class BomberFireController : public BaseParticleController | ||
{ | ||
public: | ||
void Init(); | ||
void Emit(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.