Login

Fancade Wiki

Updated Menu Item.md (markdown)

... ...
@@ -1,4 +1,4 @@
1
The Menu Item block is a script block which was added on Fancade 1.6. When it is executed at least once it activates the shop system adding a shop to the game which is only accessible when you win or lose the game. The main use of this script is to add items to a shop which should ONLY be done once per item. To learn how to use it, see [here](https://www.fancade.com/wiki/Script/How%20to%20use%20the%20shop%20system%3F.md).
1
The Menu Item block is a script block which was added on Fancade 1.6. When it is executed at least once it activates the shop system adding a shop to the game which is *only accessible when you win or lose the game.* The main use of this script is to add items to a shop which should only be done **once** per item. To learn how to use it, see [here](https://www.fancade.com/wiki/Script/How%20to%20use%20the%20shop%20system%3F.md).
2 2
3 3
[[/uploads/Menu_Item.png | width=336px]]
4 4
... ...
@@ -11,11 +11,17 @@ Though this new script made a great new mechanic for Fancade it has some limitat
11 11
Items can be either one type of upgrades or boosters just by playing with the buy limit settings and Variable input of the menu item script. You can choose between ON/OFF, Max 2-100 or no limit.
12 12
13 13
You also cannot use menu item to add buttons on the top of the screen or the pause menu. Remember the [[top of this page|#top]]?
14
## Example
15
You can make a clicker game with Menu Item. So, add a [[touch sensor]], a [[get variable]], an [[increase number]] and this script (Menu Item). Make it detect tap begins. Make it increase variables named `Coins` and `!Score`. (! means saved variable, tap `Local` then `Global` to get `Saved`.)
16 14
17
Now get a [[set score]], plug in `!Score` into the Score wire, and plug `Coins` into the Coins wire.
15
## Example usage: Clicker game
16
You can make a clicker game with Menu Item. First, add a [[Touch Sensor]] block, a [[Get Number Variable|Get Variable]] block, an [[Increase Number]] block and this script (Menu Item). Make it detect when 1st tap begins. Make it increase two variables: one named `Coins` and another one named `!Score`. (! means saved variable, tap `Local` then `Global` to get `Saved`.)
18 17
19
Add a shop with many items, starting with `More per tap`. This is like in fanclicker by Origedit. Replace the increase number with: set var (add nums, `!Score`, (whatever saved variable you are using for the more per tap item in the shop)). Do the same for the `Coins` variable.
18
Now get a [[Set Score]] block, plug in `!Score` into the Score wire, and plug `Coins` into the Coins wire.
20 19
21
Add a way to make the player claim the coins they got in game and submit their score. If you are using a button to do this then check the [[tap to pick closest object]] article, make a unglued object and repeat the scripting in the article image.
... ...
\ No newline at end of file
0
Add a shop with some items, starting with `More per tap`. This is like in Fanclicker by Origedit. Replace the increase number with:
1
2
```
3
!Score = !Score + (whatever saved variable you are using for the more per tap item in the shop).
4
```
5
Do the same for the `Coins` variable.
6
7
Add a way to make the player claim the coins they got in game and submit their score. If you are using an object to do this then check if the object has no other object around it or is unglued; if not, do so. If you don't know how to do it then check [[this article.|https://www.fancade.com/wiki/build/how-glue-makes-blocks-stick-together-and-form-larger-objects]] You may also need the [[Tap to pick closest object|https://www.fancade.com/wiki/script/tap-to-pick-closest-object]] article.
... ...
\ No newline at end of file
Fancade Wiki