forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnemyBulletCharge.cpp
71 lines (60 loc) · 1.68 KB
/
EnemyBulletCharge.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//=====================================
//
//エネミーバレットチャージ処理[EnemyBulletCharge.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "EnemyBulletCharge.h"
/**************************************
マクロ定義
***************************************/
#define ENEMYBULLETCHARGE_POS_RANGE (4.0f)
#define ENEMYBULLETCHARGE_EMIT_DURATION (150)
#define ENEMYBULLETCHARGE_LIFE (60)
/**************************************
EnemyBulletCharge初期化処理
***************************************/
void EnemyBulletCharge::Init()
{
cntFrame = 0;
active = true;
transform.Rotate(0.0f, 0.0f, RandomRangef(0.0f, 360.0f));
transform.pos.x += RandomRangef(-ENEMYBULLETCHARGE_POS_RANGE, ENEMYBULLETCHARGE_POS_RANGE);
transform.pos.y += RandomRangef(-ENEMYBULLETCHARGE_POS_RANGE, ENEMYBULLETCHARGE_POS_RANGE);
lifeFrame = ENEMYBULLETCHARGE_LIFE;
}
/**************************************
EnemyBulletCharge更新処理
***************************************/
void EnemyBulletCharge::Update()
{
cntFrame++;
float t = (float)cntFrame / lifeFrame;
Animation(t);
if (cntFrame == lifeFrame)
{
active = false;
}
}
/**************************************
EnemyBulletChargeEmitter初期化処理
***************************************/
void EnemyBulletChargeEmitter::Init()
{
cntFrame = 0;
active = true;
transform.scale = D3DXVECTOR3(1.0f, 1.0f, 1.0f);
duration = ENEMYBULLETCHARGE_EMIT_DURATION;
}
/**************************************
EnemyBulletChargeEmitter更新処理
***************************************/
void EnemyBulletChargeEmitter::Update()
{
cntFrame++;
transform.scale += D3DXVECTOR3(0.05f, 0.05f, 0.05f);
if (cntFrame == duration)
{
active = false;
}
}