-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuScene.cpp
More file actions
53 lines (42 loc) · 826 Bytes
/
MenuScene.cpp
File metadata and controls
53 lines (42 loc) · 826 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include"MenuScene.h"
MenuScene::MenuScene(std::string luaPath)
{
lua = luaL_newstate();
luaL_openlibs(lua);
lua_pushlightuserdata(lua, this);
lua_setglobal(lua, "Scene");
luaFunctionRegister();
luaNumberRegister();
luaL_dofile(lua, luaPath.c_str());
this->nextSceneNum = 0;
}
void MenuScene::hitCheckScene()
{
for (auto itr = objList.begin(); itr != objList.end(); itr++)
{
if ((*itr)->hitCheck())
{
}
}
}
void MenuScene::drawScene()
{
for (auto itr = objList.begin(); itr != objList.end(); itr++)
{
(*itr)->drawObjects(gRenderer);
}
}
int MenuScene::Update_Scene()
{
for (auto itr = objList.begin(); itr != objList.end(); itr++)
{
hitCheckScene();
}
drawScene();
Mouse::GetInstance()->setMouseState();
if (Mouse::GetInstance()->quit)
{
return -10;
}
return this->nextSceneNum;
}