forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBossBulletGuide.cpp
71 lines (62 loc) · 1.68 KB
/
BossBulletGuide.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
//=====================================
//
//ボスバレットガイド処理[BossBulletGuide.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "BossBulletGuide.h"
#include "Framework\Easing.h"
/**************************************
グローバル変数
***************************************/
/**************************************
コンストラクタ
***************************************/
BossBulletGuide::BossBulletGuide() :
Polygon2D(50.0f, 50.0f),
cntFrame(0),
Duration(60),
FadeDuration(10),
currentState(State::Idle)
{
LoadTexture("data/TEXTURE/UI/Boss/bulletGuide.png");
}
/**************************************
更新処理
***************************************/
void BossBulletGuide::Update()
{
if (cntFrame > Duration)
return;
cntFrame++;
if (cntFrame == Duration - FadeDuration)
currentState = State::Fadeout;
if (currentState == State::Fadein)
{
float t = 1.0f * cntFrame / FadeDuration;
float alpha = Easing::EaseValue(t, 0.0f,1.0f, EaseType::Linear);
SetColor(D3DXCOLOR(1.0f, 1.0f, 1.0f, alpha));
}
else if (currentState == State::Fadeout)
{
float t = 1.0f - (float)(Duration - cntFrame) / FadeDuration;
float alpha = Easing::EaseValue(t, 1.0f, 0.0f, EaseType::Linear);
SetColor(D3DXCOLOR(1.0f, 1.0f, 1.0f, alpha));
}
}
/**************************************
セット処理
***************************************/
void BossBulletGuide::Set(const D3DXVECTOR3 & pos, bool isFadein)
{
transform.pos = pos;
cntFrame = 0;
currentState = isFadein ? State::Fadein : State::Fadeout;
}
/**************************************
アクティブ判定
***************************************/
bool BossBulletGuide::IsActive()
{
return cntFrame <= Duration;
}