diff options
author | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 15:10:48 +0100 |
---|---|---|
committer | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 15:10:48 +0100 |
commit | c12366610c4d8732362d602864e805575b31a9d2 (patch) | |
tree | 84ce8c663f2e1b0bc4d392f2385b6c780f24b116 /game | |
parent | a24d1563931a19332ff2935f8d5998c997a4f94e (diff) |
Made shop
Diffstat (limited to 'game')
-rw-r--r-- | game/menus/shop/ShopMenuScene.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/game/menus/shop/ShopMenuScene.cpp b/game/menus/shop/ShopMenuScene.cpp index 21e3f02..ee0fb6b 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::YELLOW, + }, + 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::YELLOW, + }, + vec2 {-25, 75}, "1000" + ); } string ShopMenuScene::get_name() const { return SHOP_SCENE; } |