-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleSceneCastle.cpp
More file actions
55 lines (44 loc) · 1.14 KB
/
ModuleSceneCastle.cpp
File metadata and controls
55 lines (44 loc) · 1.14 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
#include "Globals.h"
#include "Application.h"
#include "ModuleSceneCastle.h"
#include "ModuleTextures.h"
#include "ModuleRender.h"
#include "ModuleInput.h"
#include "ModuleFadetoBlack.h"
#include "ModuleIntro.h"
#include "SDL/include/SDL.h"
ModuleSceneCastle::ModuleSceneCastle()
{
// Background / sky
background_castle = { 0, 0, 228, 2108 };
}
ModuleSceneCastle:: ~ModuleSceneCastle()
{}
// Load assets
bool ModuleSceneCastle::Start()
{
LOG("Loading background assets");
bool ret = true;
graphics = App->textures->Load("Castle_Background.png");
return ret;
}
// Load assets
bool ModuleSceneCastle::CleanUp()
{
// TODO 5: Remove all memory leaks
LOG("Unloading castle stage");
fading = false;
return true;
}
// Update: draw background
update_status ModuleSceneCastle::Update()
{
// Draw everything --------------------------------------
App->render->Blit(graphics, 0, -1788, &background_castle, 0.75f); // back of the room
if (App->input->keyboard[SDL_SCANCODE_SPACE] && fading == false)
{
App->fading->FadeToBlack(this, App->intro, 2.0f);
fading = true;
}// TODO 2: make so pressing SPACE the KEN stage is loaded
return UPDATE_CONTINUE;
}