forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnemyBulletFireController.cpp
57 lines (50 loc) · 1.62 KB
/
EnemyBulletFireController.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//=====================================
//
//エネミーバレットファイアコントローラ処理[EnemyBulletFireController.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "EnemyBulletFireController.h"
#include "EnemyBulletFire.h"
/**************************************
マクロ定義
***************************************/
#define ENEMYBULLETFIRE_TEX_NAME "data/TEXTURE/Effect/EnemyBulletFire.png"
#define ENEMYBULLETFIRE_NUM_MAX (1024)
#define ENEMYBULLETFIRE_EMITTER_MAX (64)
#define ENEMYBULLERFIRE_EMIT_NUM (10)
typedef BaseParticleController Base;
/**************************************
初期化処理
***************************************/
void EnemyBulletFireController::Init()
{
D3DXVECTOR2 ENEMYBULLETFIRE_SIZE = D3DXVECTOR2(3.0f, 3.0f);
D3DXVECTOR2 ENEMYBULLETFIRE_TEX_DIV = D3DXVECTOR2(1.0f, 1.0f);
//単位頂点バッファ作成、テクスチャ読み込み
Base::MakeUnitBuffer(&ENEMYBULLETFIRE_SIZE, &ENEMYBULLETFIRE_TEX_DIV);
Base::LoadTexture(ENEMYBULLETFIRE_TEX_NAME);
//パーティクルコンテナ作成
particleContainer.resize(ENEMYBULLETFIRE_NUM_MAX);
for (auto& particle : particleContainer)
{
particle = new EnemyBulletFire();
}
//エミッターコンテナ作成
emitterContainer.resize(ENEMYBULLETFIRE_EMITTER_MAX);
for (auto& emitter : emitterContainer)
{
emitter = new EnemyBulletFireEmitter();
}
}
/**************************************
放出処理
***************************************/
void EnemyBulletFireController::Emit()
{
Base::ForEachEmitter(ENEMYBULLERFIRE_EMIT_NUM, [](BaseEmitter* emitter, BaseParticle* particle)
{
particle->transform.pos = emitter->transform.pos;
particle->Init();
});
}