forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemyBulletTrail.cpp
63 lines (54 loc) · 1.49 KB
/
EnemyBulletTrail.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
//=====================================
//
//エネミーバレットトレイル処理[EnemyBulletTrail.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "EnemyBulletTrail.h"
/**************************************
マクロ定義
***************************************/
#define ENEMYBULLETTRAIL_SPEED_MIN (0.5f)
#define ENEMYBULLETTRAIL_SPEED_MAX (4.0f)
#define ENEMYBULLETTRAIL_LIFE_MIN (5)
#define ENEMYBULLETTRAIL_LIFE_MAX (30)
/**************************************
EnemyBulletTrail初期化処理
***************************************/
void EnemyBulletTrail::Init()
{
cntFrame = 0;
active = true;
speed = RandomRangef(ENEMYBULLETTRAIL_SPEED_MIN, ENEMYBULLETTRAIL_SPEED_MAX);
lifeFrame = RandomRange(ENEMYBULLETTRAIL_LIFE_MIN, ENEMYBULLETTRAIL_LIFE_MAX);
transform.Rotate(0.0f, 0.0f, RandomRangef(0.0f, 360.0f));
}
/**************************************
EnemyBulletTrail更新処理
***************************************/
void EnemyBulletTrail::Update()
{
transform.pos += speed * moveDir;
cntFrame++;
float t = (float)cntFrame / (float)lifeFrame;
Animation(t);
if (cntFrame == lifeFrame)
{
active = false;
}
}
/**************************************
EnemyBulletTrailEmitter初期化処理
***************************************/
void EnemyBulletTrailEmitter::Init()
{
prevPos = transform.pos;
cntFrame = 0;
active = true;
}
/**************************************
EnemyBulletTrailEmitter更新処理
***************************************/
void EnemyBulletTrailEmitter::Update()
{
}