-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleIntro.cpp
More file actions
56 lines (42 loc) · 1.03 KB
/
ModuleIntro.cpp
File metadata and controls
56 lines (42 loc) · 1.03 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
#include "Globals.h"
#include "Application.h"
#include "ModuleInput.h"
#include "ModuleTextures.h"
#include "ModuleRender.h"
#include "ModuleIntro.h"
#include "ModuleFadetoBlack.h"
#include "ModuleSceneCastle.h"
// Reference at https://youtu.be/6OlenbCC4WI?t=382
ModuleIntro::ModuleIntro() : Module()
{
background_intro = { 0, 0, 224, 320 };
}
ModuleIntro::~ModuleIntro()
{}
// Load assets
bool ModuleIntro::Start()
{
LOG("Loading background assets");
graphics = App->textures->Load("game ober.png");
return true;
}
// Load assets
bool ModuleIntro::CleanUp()
{
// TODO 5: Remove all memory leaks
LOG("Unloading intro");
fading = false;
return true;
}
// Update: draw background
update_status ModuleIntro::Update()
{
// Draw everything --------------------------------------
App->render->Blit(graphics, 0, 0, &background_intro, 0.75f); // back of the room
if (App->input->keyboard[SDL_SCANCODE_SPACE] && fading == false)
{
App->fading->FadeToBlack(this, App->scene_castle, 2.0f);
fading = true;
}
return UPDATE_CONTINUE;
}