-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
141 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include "Globals.h" | ||
#include "Application.h" | ||
#include "ModuleTextures.h" | ||
#include "ModuleRender.h" | ||
#include "ModuleWelcomeTitle.h" | ||
#include "ModulePlayer.h" | ||
#include "ModuleSceneMine.h" | ||
#include "ModuleInput.h" | ||
#include "ModuleFadeToBlack.h" | ||
#include "ModuleAudio.h" | ||
#include "ModuleSelection.h" | ||
|
||
ModuleSelection::ModuleSelection() | ||
{ | ||
// Background | ||
background.w = SCREEN_WIDTH; | ||
background.h = SCREEN_HEIGHT; | ||
background_x = 0; | ||
background_y = 0; | ||
} | ||
|
||
ModuleSelection::~ModuleSelection() | ||
{} | ||
|
||
// Load assets | ||
bool ModuleSelection::Start() | ||
{ | ||
LOG("Loading WelcomeTitle scene"); | ||
bool ret = true; | ||
graphics = App->textures->Load("assets/maps/selection.png"); | ||
|
||
LOG("Loading music"); | ||
App->audio->Load("assets/music/castle-welcome_title.ogg"); | ||
App->audio->Play(-1); | ||
// TODO 1: Enable (and properly disable) the player module | ||
App->player->Enable(); //Player in welcome title? | ||
fading = false; | ||
|
||
return ret; | ||
} | ||
|
||
// UnLoad assets | ||
bool ModuleSelection::CleanUp() | ||
{ | ||
LOG("Unloading selection scene"); | ||
App->audio->Stop(); | ||
App->player->Disable(); | ||
|
||
return true; | ||
} | ||
|
||
// Update: draw background | ||
|
||
update_status ModuleSelection::Update() | ||
{ | ||
// Draw everything -------------------------------------- | ||
|
||
App->render->Blit(graphics, background_x, background_y, &background, 0.75f); // Selection Screen | ||
|
||
|
||
if (App->input->keyboard[SDL_SCANCODE_SPACE] && fading == false && App->fade->GetFadeState() == false) | ||
{ | ||
App->fade->FadeToBlack(this, App->scene_mine); | ||
fading = true; | ||
} | ||
return UPDATE_CONTINUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef __MODULESELECTION_H__ | ||
#define __MODULESELECTION_H__ | ||
|
||
#include "Module.h" | ||
#include "Animation.h" | ||
#include "Globals.h" | ||
|
||
struct SDL_Texture; | ||
|
||
class ModuleSelection : public Module | ||
{ | ||
public: | ||
ModuleSelection(); | ||
~ModuleSelection(); | ||
|
||
bool Start(); | ||
update_status Update(); | ||
bool CleanUp(); | ||
|
||
public: | ||
|
||
SDL_Texture* graphics = nullptr; | ||
SDL_Rect background; | ||
bool fading; | ||
int background_x; | ||
int background_y; | ||
}; | ||
|
||
#endif // __MODULESELECTION_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters