-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleSceneIntro.cpp
More file actions
51 lines (38 loc) · 999 Bytes
/
ModuleSceneIntro.cpp
File metadata and controls
51 lines (38 loc) · 999 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
#include "Globals.h"
#include "Application.h"
#include "ModuleTextures.h"
#include "ModuleAudio.h"
#include "ModuleInput.h"
#include "ModuleRender.h"
#include "ModuleFadeToBlack.h"
#include "ModuleSceneIntro.h"
// Reference at https://www.youtube.com/watch?v=OEhmUuehGOA
ModuleSceneIntro::ModuleSceneIntro()
{}
ModuleSceneIntro::~ModuleSceneIntro()
{}
// Load assets
bool ModuleSceneIntro::Start()
{
LOG("Loading space intro");
background = App->textures->Load("rtype/intro.png");
App->render->camera.x = App->render->camera.y = 0;
return true;
}
// UnLoad assets
bool ModuleSceneIntro::CleanUp()
{
LOG("Unloading space scene");
App->textures->Unload(background);
return true;
}
// Update: draw background
update_status ModuleSceneIntro::Update()
{
App->render->Blit(background, 0, 0, NULL);
if(App->input->keyboard[SDL_SCANCODE_SPACE] == KEY_DOWN && App->fade->IsFading() == false)
{
App->fade->FadeToBlack(this, (Module*)App->scene_space);
}
return UPDATE_CONTINUE;
}