-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverScene.cpp
More file actions
61 lines (51 loc) · 1.32 KB
/
overScene.cpp
File metadata and controls
61 lines (51 loc) · 1.32 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
#pragma once
#include "stdafx.h"
#include "overScene.h"
extern WGameFramework framework;
overScene::~overScene()
{
}
void overScene::init()
{
//메뉴 화면에서 그릴 리소스 위치 초기화
background1.Load(TEXT("image/오버배경.png"));
txt.Load(TEXT("image/gameover.png"));
PlaySound(TEXT("sound/level1-step1.wav"), NULL, SND_ASYNC | SND_LOOP);
ren1 = 0;
y = 0;
}
void overScene::processKey(UINT iMessage, WPARAM wParam, LPARAM lParam)
{
switch (iMessage)
{
case WM_KEYDOWN:
{
switch (wParam) {
case VK_RETURN:
PlaySound(NULL, NULL, NULL);
scene* scene = framework.curScene; ////현재 씬을 tmp에 넣고 지워줌
framework.curScene = new gameScene;
framework.curScene->init();
framework.nowscene = GAME;
delete scene;
break;
}
}
break;
}
}
void overScene::Update(const float frameTime)
{
ren1++;
if (ren1 >= 10)
ren1 = 0;
if (y > -400)
y -= 20;
//애니메이션 있으면 여기서 업데이트
}
void overScene::Render(HDC hdc)
{
background1.Draw(hdc, 0, 0, FRAME_WIDTH, FRAME_HEIGHT, 0, 0, background1.GetWidth(), background1.GetHeight());
txt.Draw(hdc, 0, y, FRAME_WIDTH, FRAME_HEIGHT, 0, 0, txt.GetWidth(), txt.GetHeight());
//--- 메모리 DC에 배경 그리기
}