-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter.cpp
More file actions
32 lines (29 loc) · 733 Bytes
/
Character.cpp
File metadata and controls
32 lines (29 loc) · 733 Bytes
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
#include "Character.h"
#include "Koopa.h"
#include "PlayScene.h"
#include "Mario.h"
#include "Smoke.h"
#include "GameData.h"
#include "ScoreManager.h"
void CCharacter::Touched()
{
CPlayScene* scene = (CPlayScene*)(CGame::GetInstance()->GetCurrentScene());
CMario* mario = dynamic_cast<CMario*>(scene->GetPlayer());
mario->Attacked();
}
void CCharacter::Ending()
{
CSmoke* smoke = new CSmoke(x, y);
((LPPLAYSCENE)CGame::GetInstance()->GetCurrentScene())->AddObject(smoke);
CScoreManager::GetInstance()->AddScore(x, y, SCORE_1000);
isDeleted = true;
}
void CCharacter::OnOverlapWith(LPCOLLISIONEVENT e)
{
{
if (CKoopa *koopa = dynamic_cast<CKoopa*>(e->obj))
{
if (koopa->IsMoving()) ShellHit(koopa->GetX());
}
}
}