-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLD32.cpp
More file actions
34 lines (31 loc) · 948 Bytes
/
LD32.cpp
File metadata and controls
34 lines (31 loc) · 948 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
#include "LD32.hpp"
#include <Engine/Factory.hpp>
#include <Engine/Scene.hpp>
#include "TitleScreen.hpp"
#include "Level.hpp"
LD32::LD32(): m_unlocks{}, m_score(0) {
m_windowTitle ="LD32 - Vampire Slayer Deluxe (c) imer.cc 2015";
m_scene = engine::Factory::create<TitleScreen>("assets/scripts/title_menu.json", this);
engine::Factory::CreateChildFromFile("assets/scripts/loading_bg.json", &m_loadingScene);
//m_window.setVerticalSyncEnabled(true);
}
LD32::~LD32() {
}
void LD32::StartGame() {
SwitchScene(engine::Factory::create<Level>("assets/scripts/level_2.json", this));
}
void LD32::Unlock(WeaponType wt){
m_unlocks[wt] = true;
if (m_scene) {
auto selector = m_scene->GetUi()->GetChildByID("selector");
if (selector) {
auto s = static_cast<engine::SpriteNode*>(selector->GetChildByID(weapons[wt].name));
if (s) {
s->PlayAnimation("default");
}
}
}
}
bool LD32::IsUnlocked(WeaponType wt) {
return m_unlocks[wt];
}