Discuss Scratch

EpicTheCreator
Scratcher
20 posts

how to make working shop for my game

i realized i cant use the same key for every single shop item to be purchased, can someone help me out?
https://scratch.mit.edu/projects/622042440/
Dusteon
Scratcher
54 posts

how to make working shop for my game

Uh my suggestion is you could create a list Called inventory and a variable called on hand the list will store everything the player has and the on hand vaiable will store what the player is holding i suppose you could do the coding part i just told the theory part
FinniboiXD
Scratcher
89 posts

how to make working shop for my game

Try checking out my game's shop, it shows the buying options when the backdrop switches to the shop background, and using variables, you can use them as upgrades and such. If you have enough currency, it will buy and you won't be able to buy it again: https://scratch.mit.edu/projects/611824419
Instead of pressing keys, you click the icons. Take a look at the code. Hope that helps!

-FinniboiXD

Last edited by FinniboiXD (Dec. 31, 2021 13:19:11)

samuelspinelli1
Scratcher
38 posts

how to make working shop for my game

Dusteon wrote:

Uh my suggestion is you could create a list Called inventory and a variable called on hand the list will store everything the player has and the on hand vaiable will store what the player is holding i suppose you could do the coding part i just told the theory part
Yeah, I think a list would work best when buying/selling items, an index variable could be useful as well. I've used lists for shops before and they work quite well, if you don't have much knowlege on lists, you could try just using different variables for each sprite. If you need some coding examples ask me!
FizzyCool567
New Scratcher
2 posts

how to make working shop for my game

here's my script (yes I used yt)
when green flag clicked
show
switch costume to [costume1 v]
forever
if <<<touching [mouse-pointer v] ?> and <mouse down?>><> and <<(money) > [10]> or <(money) = [10]>> then
change [ thing player wants to buy] by (1)
change [ money] by (-10)
end
if you want to make it sold out use the script and just add
broadcast [sold out v]
when I receive [sold out v]
forever
stop [other scripts in sprite v]
end

hope this helps
TheSteakHunt
New Scratcher
1 post

how to make working shop for my game

how do I make it so that it records what I bought when I did, like should I use the “Make clone of myself” block or what should I do?

Thank you I am making a clicker

100001011110
Scratcher
94 posts

how to make working shop for my game

Please dont necropost!
(This means posting on a topic that was made a long time ago)
10goto10
Scratcher
1000+ posts

how to make working shop for my game

TheSteakHunt wrote:

how do I make it so that it records what I bought when I did, like should I use the “Make clone of myself” block or what should I do?
Good luck with your game. Because it’s confusing when people add a reply for help to someone else’s existing topic it’s just better to avoid doing that.

Usually people use variables to keep track of purchases but if you will share your project, make your own topic and post a link to your project then you’ll get the best help with your question.

Last edited by 10goto10 (Nov. 12, 2025 22:45:57)

Powered by DjangoBB