-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModuleSceneWin.cpp
More file actions
63 lines (51 loc) · 1.27 KB
/
ModuleSceneWin.cpp
File metadata and controls
63 lines (51 loc) · 1.27 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
57
58
59
60
61
62
63
//=================================
// forward declared dependencies
//=================================
// included dependencies
#include "Application.h"
#include "ModuleAudio.h"
#include "ModuleInput.h"
#include "ModuleFadeToBlack.h"
#include "ModuleRender.h"
#include "ModuleTextures.h"
#include "ModuleSceneIntro.h"
#include "ModuleSceneWin.h"
//=================================
// the actual class
ModuleSceneWin::ModuleSceneWin(Application *app, bool start_enabled) : Module(app, start_enabled)
{
graphics = NULL;
}
ModuleSceneWin::~ModuleSceneWin()
{ }
// Load assets
bool ModuleSceneWin::start()
{
LOG("Loading Win assets");
bool ret = true;
app->audio->playMusic("Music/Win_Music.wav", 1.0f);
graphics = app->textures->load("Images/Win.png");
app->renderer->camera.x = app->renderer->camera.y = 0;
return ret;
}
// Delete assets
bool ModuleSceneWin::cleanUp()
{
LOG("Unloading Win scene");
app->textures->unload(graphics);
return true;
}
// Update: draw background
update_status ModuleSceneWin::update()
{
// Draw everything
app->renderer->blit(graphics, 0, 0, NULL);
if (app->input->keyboard_enabled == true)
{
if (app->input->getKey(SDL_SCANCODE_SPACE) == KEY_UP)
{
app->fade->fadeToBlack(this, app->scene_intro, 3.0f);
}
}
return UPDATE_CONTINUE;
}