commit c2772f99
Added a non touchable potato to the world
Changed files
| M | data/sprites/food.sprite before |
| M | data/sprites/items.sprite before |
| M | src/saland.cpp before |
| M | src/saland/GameRegion.cpp before |
diff --git a/data/sprites/food.sprite b/data/sprites/food.sprite
index ee861a7..cfcf539 100644
--- a/data/sprites/food.sprite
+++ b/data/sprites/food.sprite
@@ -1,11 +1,13 @@
{
-"potato" : {
+"item_food_potato" : {
"texture" : "food",
"topx" : 0,
"topy" : 0,
"height" : 32,
- "width" : 32
+ "width" : 32,
+ "originx" : 16,
+ "originy" : 16
}
}
\ No newline at end of file
diff --git a/data/sprites/items.sprite b/data/sprites/items.sprite
index a58e08d..896ab01 100644
--- a/data/sprites/items.sprite
+++ b/data/sprites/items.sprite
@@ -8,8 +8,8 @@
"width" : 32,
"number_of_frames" : 1,
"frame_time" : 100,
- "originx" : 16,
- "originy" : 50
+ "originx" : 16,
+ "originy" : 50
}
}
\ No newline at end of file
diff --git a/src/saland.cpp b/src/saland.cpp
index ff6a7a2..46644af 100644
--- a/src/saland.cpp
+++ b/src/saland.cpp
@@ -90,7 +90,7 @@ public:
bee.Draw(globalData.screen, SDL_GetTicks(), 100, 200);
const sago::SagoSprite& bat = globalData.spriteHolder->GetSprite("bat_W");
bat.Draw(globalData.screen, SDL_GetTicks(), 200, 200);
- const sago::SagoSprite& potato = globalData.spriteHolder->GetSprite("potato");
+ const sago::SagoSprite& potato = globalData.spriteHolder->GetSprite("item_food_potato");
potato.Draw(globalData.screen, SDL_GetTicks(), 240, 200);
}
diff --git a/src/saland/GameRegion.cpp b/src/saland/GameRegion.cpp
index 03ac58d..3ec22a5 100644
--- a/src/saland/GameRegion.cpp
+++ b/src/saland/GameRegion.cpp
@@ -56,6 +56,13 @@ void GameRegion::Init(int x, int y, const std::string& worldName, bool forceRese
barrel.get()->Y = 100.0f;
placeables.push_back(barrel);
+ std::shared_ptr<MiscItem> potato = std::make_shared<MiscItem>();
+ potato.get()->Radius = 9.0f;
+ potato.get()->sprite = "item_food_potato";
+ potato.get()->X = 700.0f;
+ potato.get()->X = 600.0f;
+ placeables.push_back(potato);
+
std::shared_ptr<Monster> bat = std::make_shared<Monster>();
bat.get()->Radius = 16.0f;