diff options
Diffstat (limited to 'game')
-rw-r--r-- | game/Config.h | 3 | ||||
-rw-r--r-- | game/hud/HudSubScene.cpp | 2 | ||||
-rw-r--r-- | game/menus/shop/ShopMenuScene.cpp | 71 | ||||
-rw-r--r-- | game/player/PlayerEndScript.cpp | 2 |
4 files changed, 76 insertions, 2 deletions
diff --git a/game/Config.h b/game/Config.h index f1b64b3..c2f95c0 100644 --- a/game/Config.h +++ b/game/Config.h @@ -45,3 +45,6 @@ static constexpr const char * DISTANCE_RUN = "distance_run"; static constexpr const char * PLAYER_NAME = "player"; static constexpr int PLAYER_SPEED = 7500; // In game units static constexpr int PLAYER_GRAVITY_SCALE = 60; // In game units + +// Jetpack particles +static constexpr const char * JETPACK_PARTICLES = "jetpack_particles"; diff --git a/game/hud/HudSubScene.cpp b/game/hud/HudSubScene.cpp index ca81614..dcc07b4 100644 --- a/game/hud/HudSubScene.cpp +++ b/game/hud/HudSubScene.cpp @@ -45,7 +45,7 @@ void HudSubScene::create(Scene & scn) { size_coin, FONT, Text::Data { .world_space = false, - .text_color = Color::YELLOW, + .text_color = Color::GOLD, }, TOP_LEFT + FONTOFFSET + COINS_OFFSET + vec2 {COINS_LENGTH * COINS_CHAR_WIDTH / 2, 0}, COINS diff --git a/game/menus/shop/ShopMenuScene.cpp b/game/menus/shop/ShopMenuScene.cpp index 21e3f02..d1ea81d 100644 --- a/game/menus/shop/ShopMenuScene.cpp +++ b/game/menus/shop/ShopMenuScene.cpp @@ -1,12 +1,15 @@ #include "ShopMenuScene.h" +#include "../../Config.h" #include "../BannerSubScene.h" #include "../ButtonSubScene.h" #include "../MenusConfig.h" +#include "types.h" #include <crepe/api/Camera.h> #include <crepe/api/Sprite.h> +#include <crepe/api/Text.h> using namespace crepe; using namespace std; @@ -50,6 +53,74 @@ void ShopMenuScene::load_scene() { .scale = 0.8 } ); + + GameObject shop_item_bullet = this->new_object("bullet", "shop_item", vec2(-100, 0)); + shop_item_bullet.add_component<Sprite>( + Asset("asset/other_effects/effect_rocketmgshell_TVOS.png"), + Sprite::Data { + .sorting_in_layer = STARTING_SORTING_IN_LAYER + 1, + .size = {0, 100}, + .position_offset = {0, 0}, + } + ); + shop_item_bullet.add_component<Text>( + vec2 {100, 50}, FONT, + Text::Data { + .world_space = true, + .text_color = Color::WHITE, + }, + vec2 {0, -75}, "BULLETS" + ); + shop_item_bullet.add_component<Sprite>( + Asset("asset/ui/buttonCoinsSmall.png"), + Sprite::Data { + .sorting_in_layer = STARTING_SORTING_IN_LAYER + 1, + .size = {0, 45}, + .position_offset = {25, 75}, + } + ); + shop_item_bullet.add_component<Text>( + vec2 {37.5, 37.5}, FONT, + Text::Data { + .world_space = true, + .text_color = Color::GOLD, + }, + vec2 {-25, 75}, "0" + ); + + GameObject shop_item_bubble = this->new_object("bubble", "shop_item", vec2(100, 0)); + shop_item_bubble.add_component<Sprite>( + Asset("asset/background/aquarium/bubble.png"), + Sprite::Data { + .sorting_in_layer = STARTING_SORTING_IN_LAYER + 1, + .size = {0, 100}, + .position_offset = {0, 0}, + } + ); + shop_item_bubble.add_component<Text>( + vec2 {100, 50}, FONT, + Text::Data { + .world_space = true, + .text_color = Color::WHITE, + }, + vec2 {0, -75}, "BUBBLE" + ); + shop_item_bubble.add_component<Sprite>( + Asset("asset/ui/buttonCoinsSmall.png"), + Sprite::Data { + .sorting_in_layer = STARTING_SORTING_IN_LAYER + 1, + .size = {0, 45}, + .position_offset = {45, 75}, + } + ); + shop_item_bubble.add_component<Text>( + vec2 {100, 25}, FONT, + Text::Data { + .world_space = true, + .text_color = Color::GOLD, + }, + vec2 {-25, 75}, "1000" + ); } string ShopMenuScene::get_name() const { return SHOP_SCENE; } diff --git a/game/player/PlayerEndScript.cpp b/game/player/PlayerEndScript.cpp index fb18f2f..047dbb0 100644 --- a/game/player/PlayerEndScript.cpp +++ b/game/player/PlayerEndScript.cpp @@ -90,7 +90,7 @@ bool PlayerEndScript::on_collision(const crepe::CollisionEvent & ev) { jump++; } - if (rb_player.data.linear_velocity.x < 5) { + if (rb_player.data.linear_velocity.x < 5 && jump >= 3) { this->trigger_event<EndGameEvent>(); } |