aboutsummaryrefslogtreecommitdiff
path: root/game/coins/CoinSubScene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/coins/CoinSubScene.cpp')
-rw-r--r--game/coins/CoinSubScene.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/game/coins/CoinSubScene.cpp b/game/coins/CoinSubScene.cpp
index 12ddb7a..97f5877 100644
--- a/game/coins/CoinSubScene.cpp
+++ b/game/coins/CoinSubScene.cpp
@@ -5,6 +5,7 @@
#include "api/Scene.h"
#include "api/AudioSource.h"
#include <concepts>
+#include <iostream>
using namespace crepe;
using namespace std;
@@ -13,10 +14,10 @@ int CoinSubScene::create(Scene & scn){
vec2 size = {20, 20};
static int coin_counter = 0;
- std::string unique_name = "coin_" + std::to_string(coin_counter++);
+ string unique_name = "coin_" + to_string(coin_counter++);
+ cout << "new coin: "<< unique_name << endl;
-
- GameObject coin = scn.new_object(unique_name.c_str(),"coin",vec2{0,0},0,1);
+ GameObject coin = scn.new_object(unique_name.c_str(),"coin",vec2{650,0},0,1);
coin.add_component<Rigidbody>(Rigidbody::Data{});
coin.add_component<CircleCollider>(size.x / 2).active = false;
crepe::OptionalRef<crepe::Sprite> coin_sprite = coin.add_component<Sprite>(Asset{"asset/coin/coin1_TVOS.png"}, Sprite::Data{
@@ -24,7 +25,7 @@ int CoinSubScene::create(Scene & scn){
.order_in_layer = 100,
.size = size,
});
- // coin_sprite->active = false;
+ coin_sprite->active = false;
coin.add_component<Animator>(coin_sprite, ivec2{32, 32}, uvec2{8, 1},
Animator::Data{
.fps = 15,