Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » i need help with shop and buy in a clicker
- Jackson9050
-
Scratcher
64 posts
i need help with shop and buy in a clicker
im trying to make clicker game and i want to add a shop and buy thing but i don't know how, can someone help me
- LankyBox01
-
Scratcher
1000+ posts
i need help with shop and buy in a clicker
Sure, create a sprite called “shop_button” and add the following script to it:
Then create a sprite called “shop” and add the following scripts to it:
Then create a sprite called “upgrade01” and add the following scripts to it:
And then, go to the main clicker sprite (the sprite that you click) and modify it like so:
Now, if you upgrade, you will get twice the points when you click!
when this sprite clicked
broadcast [shop v]
Then create a sprite called “shop” and add the following scripts to it:
when green flag clicked
hide
when I receive [shop v]
show
when I receive [shop_close v]
hide
Then create a sprite called “upgrade01” and add the following scripts to it:
when green flag clicked
set [upgraded v] to [0]
hide
when I receive [shop v]
show
when this sprite clicked
broadcast [shop_close v]
set [upgraded v] to [1]
And then, go to the main clicker sprite (the sprite that you click) and modify it like so:
when this sprite clicked
if <(upgraded) = [1]> then
change [score v] by (1)
else
change [score v] by (2)
end
Now, if you upgrade, you will get twice the points when you click!
- webelofox13
-
New Scratcher
2 posts
i need help with shop and buy in a clicker
I am assuming that you already have a shop in mind with items. You can start with a “go to shop” button:
when this sprite clickedThen to the shop:
broadcast [go to shop]
when I receive [go to shop]for all of the sprites you want or use:
show
switch backdrop to [shop backdrop]Finally for all of the shop items, to subtract from price:
when this sprite clickedShow the object clicked on during the main game play, do:
change [total money] by (- whatever value you want)
go to x: (wherever) y: (wherever)And finally for everything during the main gameplay:
set size to (whatever size) %
create clone of [myself]
hide
broadcast [back to game]
when I receive [back to game]
hide
and/or
switch backdrop to [game backdrop]
- Discussion Forums
- » Help with Scripts
-
» i need help with shop and buy in a clicker