Move assets to assets/demo
|
@ -1,4 +1,4 @@
|
||||||
copy("assets") {
|
copy("demo") {
|
||||||
sources = [
|
sources = [
|
||||||
"bead.png",
|
"bead.png",
|
||||||
"boss_explosion.mp3",
|
"boss_explosion.mp3",
|
||||||
|
@ -40,5 +40,5 @@ copy("assets") {
|
||||||
"woom_logo_start_frames_02-03.png",
|
"woom_logo_start_frames_02-03.png",
|
||||||
]
|
]
|
||||||
|
|
||||||
outputs = ["$root_out_dir/assets/{{source_file_part}}"]
|
outputs = ["$root_out_dir/assets/demo/{{source_file_part}}"]
|
||||||
}
|
}
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 332 KiB After Width: | Height: | Size: 332 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 219 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
|
@ -156,7 +156,7 @@ utils.addGameTask('runNinjaFor') { String taskName, String buildType, String arc
|
||||||
dependsOn "runGnFor${arch}${buildType}"
|
dependsOn "runGnFor${arch}${buildType}"
|
||||||
|
|
||||||
executable rootProject.ext.ninja
|
executable rootProject.ext.ninja
|
||||||
args '-C', "${utils.getOutDir(buildType)}/${arch}", utils.getGnTargetFor(game)
|
args '-C', "${utils.getOutDir(buildType)}/${arch}", "src/${utils.getGnTargetFor(game)}"
|
||||||
|
|
||||||
// Always run ninja and let it figure out what needs to be compiled.
|
// Always run ninja and let it figure out what needs to be compiled.
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
|
|
|
@ -19,7 +19,7 @@ game("demo") {
|
||||||
"sky_quad.h",
|
"sky_quad.h",
|
||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
"//assets",
|
"//assets/demo",
|
||||||
"//src/base",
|
"//src/base",
|
||||||
"//src/engine",
|
"//src/engine",
|
||||||
]
|
]
|
||||||
|
|
|
@ -45,15 +45,15 @@ Demo::~Demo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Demo::PreInitialize() {
|
bool Demo::PreInitialize() {
|
||||||
if (!font_.Load("PixelCaps!.ttf"))
|
if (!font_.Load("demo/PixelCaps!.ttf"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Engine::Get().SetShaderSource("sky_without_nebula",
|
Engine::Get().SetShaderSource("sky_without_nebula",
|
||||||
"sky_without_nebula.glsl");
|
"demo/sky_without_nebula.glsl");
|
||||||
Engine::Get().SetShaderSource("sky", "sky.glsl");
|
Engine::Get().SetShaderSource("sky", "demo/sky.glsl");
|
||||||
|
|
||||||
Engine::Get().AsyncLoadSound("music", "Game_2_Main.mp3", true);
|
Engine::Get().AsyncLoadSound("music", "demo/Game_2_Main.mp3", true);
|
||||||
Engine::Get().AsyncLoadSound("boss_music", "Game_2_Boss.mp3", true);
|
Engine::Get().AsyncLoadSound("boss_music", "demo/Game_2_Boss.mp3", true);
|
||||||
|
|
||||||
if (!enemy_.PreInitialize()) {
|
if (!enemy_.PreInitialize()) {
|
||||||
LOG(0) << "Failed to create the enemy.";
|
LOG(0) << "Failed to create the enemy.";
|
||||||
|
|
|
@ -78,17 +78,20 @@ Enemy::Enemy() = default;
|
||||||
Enemy::~Enemy() = default;
|
Enemy::~Enemy() = default;
|
||||||
|
|
||||||
bool Enemy::PreInitialize() {
|
bool Enemy::PreInitialize() {
|
||||||
Engine::Get().SetImageSource("skull_tex", "enemy_anims_01_frames_ok.png",
|
Engine::Get().SetImageSource("skull_tex", "demo/enemy_anims_01_frames_ok.png",
|
||||||
true);
|
true);
|
||||||
Engine::Get().SetImageSource("bug_tex", "enemy_anims_02_frames_ok.png", true);
|
Engine::Get().SetImageSource("bug_tex", "demo/enemy_anims_02_frames_ok.png",
|
||||||
Engine::Get().SetImageSource("boss_tex1", "Boss_ok.png", true);
|
|
||||||
Engine::Get().SetImageSource("boss_tex2", "Boss_ok_lvl2.png", true);
|
|
||||||
Engine::Get().SetImageSource("boss_tex3", "Boss_ok_lvl3.png", true);
|
|
||||||
Engine::Get().SetImageSource("target_tex", "enemy_target_single_ok.png",
|
|
||||||
true);
|
true);
|
||||||
Engine::Get().SetImageSource("blast_tex", "enemy_anims_blast_ok.png", true);
|
Engine::Get().SetImageSource("boss_tex1", "demo/Boss_ok.png", true);
|
||||||
Engine::Get().SetImageSource("shield_tex", "woom_enemy_shield.png", true);
|
Engine::Get().SetImageSource("boss_tex2", "demo/Boss_ok_lvl2.png", true);
|
||||||
Engine::Get().SetImageSource("crate_tex", "nuke_pack_OK.png", true);
|
Engine::Get().SetImageSource("boss_tex3", "demo/Boss_ok_lvl3.png", true);
|
||||||
|
Engine::Get().SetImageSource("target_tex", "demo/enemy_target_single_ok.png",
|
||||||
|
true);
|
||||||
|
Engine::Get().SetImageSource("blast_tex", "demo/enemy_anims_blast_ok.png",
|
||||||
|
true);
|
||||||
|
Engine::Get().SetImageSource("shield_tex", "demo/woom_enemy_shield.png",
|
||||||
|
true);
|
||||||
|
Engine::Get().SetImageSource("crate_tex", "demo/nuke_pack_OK.png", true);
|
||||||
|
|
||||||
for (int i = 0; i < kEnemyType_Max; ++i) {
|
for (int i = 0; i < kEnemyType_Max; ++i) {
|
||||||
if (i == kEnemyType_PowerUp)
|
if (i == kEnemyType_PowerUp)
|
||||||
|
@ -99,16 +102,16 @@ bool Enemy::PreInitialize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Engine::Get().SetShaderSource("chromatic_aberration",
|
Engine::Get().SetShaderSource("chromatic_aberration",
|
||||||
"chromatic_aberration.glsl");
|
"demo/chromatic_aberration.glsl");
|
||||||
|
|
||||||
Engine::Get().AsyncLoadSound("boss_intro", "boss_intro.mp3");
|
Engine::Get().AsyncLoadSound("boss_intro", "demo/boss_intro.mp3");
|
||||||
Engine::Get().AsyncLoadSound("boss_explosion", "boss_explosion.mp3");
|
Engine::Get().AsyncLoadSound("boss_explosion", "demo/boss_explosion.mp3");
|
||||||
Engine::Get().AsyncLoadSound("explosion", "explosion.mp3");
|
Engine::Get().AsyncLoadSound("explosion", "demo/explosion.mp3");
|
||||||
Engine::Get().AsyncLoadSound("stealth", "stealth.mp3");
|
Engine::Get().AsyncLoadSound("stealth", "demo/stealth.mp3");
|
||||||
Engine::Get().AsyncLoadSound("shield", "shield.mp3");
|
Engine::Get().AsyncLoadSound("shield", "demo/shield.mp3");
|
||||||
Engine::Get().AsyncLoadSound("hit", "hit.mp3");
|
Engine::Get().AsyncLoadSound("hit", "demo/hit.mp3");
|
||||||
Engine::Get().AsyncLoadSound("powerup-spawn", "powerup-spawn.mp3");
|
Engine::Get().AsyncLoadSound("powerup-spawn", "demo/powerup-spawn.mp3");
|
||||||
Engine::Get().AsyncLoadSound("powerup-pick", "powerup-pick.mp3");
|
Engine::Get().AsyncLoadSound("powerup-pick", "demo/powerup-pick.mp3");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ Menu::~Menu() = default;
|
||||||
|
|
||||||
bool Menu::PreInitialize() {
|
bool Menu::PreInitialize() {
|
||||||
click_sound_ = std::make_shared<Sound>();
|
click_sound_ = std::make_shared<Sound>();
|
||||||
if (!click_sound_->Load("menu_click.mp3", false))
|
if (!click_sound_->Load("demo/menu_click.mp3", false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Demo* game = static_cast<Demo*>(Engine::Get().GetGame());
|
Demo* game = static_cast<Demo*>(Engine::Get().GetGame());
|
||||||
|
@ -72,12 +72,12 @@ bool Menu::PreInitialize() {
|
||||||
|
|
||||||
Engine::Get().SetImageSource("menu_tex",
|
Engine::Get().SetImageSource("menu_tex",
|
||||||
std::bind(&Menu::CreateMenuImage, this), true);
|
std::bind(&Menu::CreateMenuImage, this), true);
|
||||||
Engine::Get().SetImageSource("logo_tex0", "woom_logo_start_frames_01.png",
|
Engine::Get().SetImageSource("logo_tex0",
|
||||||
true);
|
"demo/woom_logo_start_frames_01.png", true);
|
||||||
Engine::Get().SetImageSource("logo_tex1", "woom_logo_start_frames_02-03.png",
|
Engine::Get().SetImageSource("logo_tex1",
|
||||||
true);
|
"demo/woom_logo_start_frames_02-03.png", true);
|
||||||
Engine::Get().SetImageSource("buttons_tex", "menu_icons.png", true);
|
Engine::Get().SetImageSource("buttons_tex", "demo/menu_icons.png", true);
|
||||||
Engine::Get().SetImageSource("renderer_logo", "renderer_logo.png", true);
|
Engine::Get().SetImageSource("renderer_logo", "demo/renderer_logo.png", true);
|
||||||
|
|
||||||
Engine::Get().SetImageSource(
|
Engine::Get().SetImageSource(
|
||||||
"version_tex",
|
"version_tex",
|
||||||
|
|
|
@ -30,14 +30,15 @@ Player::Player() = default;
|
||||||
Player::~Player() = default;
|
Player::~Player() = default;
|
||||||
|
|
||||||
bool Player::PreInitialize() {
|
bool Player::PreInitialize() {
|
||||||
Engine::Get().SetImageSource("weapon_tex", "enemy_anims_flare_ok.png", true);
|
Engine::Get().SetImageSource("weapon_tex", "demo/enemy_anims_flare_ok.png",
|
||||||
Engine::Get().SetImageSource("beam_tex", "enemy_ray_ok.png", true);
|
true);
|
||||||
Engine::Get().SetImageSource("nuke_symbol_tex", "nuke_frames.png", true);
|
Engine::Get().SetImageSource("beam_tex", "demo/enemy_ray_ok.png", true);
|
||||||
Engine::Get().SetImageSource("health_bead", "bead.png", true);
|
Engine::Get().SetImageSource("nuke_symbol_tex", "demo/nuke_frames.png", true);
|
||||||
|
Engine::Get().SetImageSource("health_bead", "demo/bead.png", true);
|
||||||
|
|
||||||
Engine::Get().AsyncLoadSound("laser", "laser.mp3");
|
Engine::Get().AsyncLoadSound("laser", "demo/laser.mp3");
|
||||||
Engine::Get().AsyncLoadSound("nuke", "nuke.mp3");
|
Engine::Get().AsyncLoadSound("nuke", "demo/nuke.mp3");
|
||||||
Engine::Get().AsyncLoadSound("no_nuke", "no_nuke.mp3");
|
Engine::Get().AsyncLoadSound("no_nuke", "demo/no_nuke.mp3");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|