-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartScene.cpp
More file actions
76 lines (64 loc) · 2.04 KB
/
StartScene.cpp
File metadata and controls
76 lines (64 loc) · 2.04 KB
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
72
73
74
75
76
#include "stdafx.h"
#include "StartScene.h"
StartScene::StartScene()
{
}
StartScene::~StartScene()
{
}
HRESULT StartScene::Init()
{
_background = new ImageObject();
_background->renderer->Init("map.bmp", 10224, 1494);
_background->transform->SetPosition(10224 / 2, 1494 / 2);
_mapWidth = _background->renderer->width;
_mapHeight = _background->renderer->height;
mainCam = new Cam();
mainCam->camera->SetMapSize(_mapWidth, _mapHeight);
mainCam->transform->SetPosition(WINSIZEX / 2, WINSIZEY / 2);
rockman.Init();
smallObj.renderer->Init("small_object.bmp", 98, 224);
smallObj.collider->SetSize(98, 224);
smallObj.transform->SetPosition(WINSIZEX/2 - 200, WINSIZEY/2 + 200);
_bigObj.GetComponent<Renderer>()->Init("big_object.bmp", 104, 320);
_bigObj.GetComponent<BoxCollider>()->SetSize(104, 320);
_bigObj.transform->SetPosition(WINSIZEX / 2 + 200, WINSIZEY / 2 + 200);
_airObj.GetComponent<Renderer>()->Init("air_object.bmp", 128, 72);
_airObj.GetComponent<BoxCollider>()->SetSize(128, 72);
_airObj.transform->SetPosition(WINSIZEX / 2 + 400, WINSIZEY / 2 + 200);
_ground = new GameObject();
_ground->AddComponent(new BoxCollider());
_ground->GetComponent<BoxCollider>()->Init();
_ground->GetComponent<BoxCollider>()->SetSize(800, 100);
_ground->transform->SetPosition(WINSIZEX/2, WINSIZEY/2 + 240);
clearTrigger = new ClearTrigger();
clearTrigger->Init(&rockman);
clearZone.AddComponent(clearTrigger);
clearZone.transform->SetPosition(WINSIZEX / 2 + 100, WINSIZEY / 2 + 140);
return S_OK;
}
void StartScene::Release()
{
}
void StartScene::Update()
{
_background->Update();
rockman.Update();
smallObj.Update();
_bigObj.Update();
_airObj.Update();
_ground->Update();
mainCam->Update();
clearZone.Update();
}
void StartScene::Render()
{
_background->Render();
rockman.Render();
smallObj.Render();
_bigObj.Render();
_airObj.Render();
_ground->Render();
clearZone.Render();
mainCam->camera->Render(_hdc);
}