forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBossDefeat.cpp
46 lines (38 loc) · 1.07 KB
/
BossDefeat.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
//=====================================
//
//ボス撃破処理[BossDefeat.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "BossDefeat.h"
#include "BossEnemyActor.h"
/**************************************
マクロ定義
***************************************/
/**************************************
クラス定義
***************************************/
void BossEnemyModel::BossDefeat::OnStart(BossEnemyModel* entity)
{
cntFrame = 0;
entity->ChargeExplode(effect, core);
}
/**************************************
グローバル変数
***************************************/
int BossEnemyModel::BossDefeat::OnUpdate(BossEnemyModel* entity)
{
const int AnimationChangeTiming = 10;
const int FinishTiming = 240;
cntFrame++;
effect->pos = entity->actor->GetActorPosition();
core->pos = entity->actor->GetActorPosition();
if(cntFrame == AnimationChangeTiming)
entity->actor->ChangeAnimation(BossEnemyActor::AnimID::Defeat);
if (cntFrame == FinishTiming)
{
entity->isDestroyed = true;
entity->Explode();
}
return BossEnemyModel::State::Defeat;
}