[Tutorial TyranoBuilder] How to remove items on screen after you click it
23
0
0
0
1
ShareFavoritePlaylistsFlag
8oni
8oni
Published
CREDIT :
http://grammahobbes.deviantart.com/art/Gem-622607049
http://grammahobbes.deviantart.com/art/Lollipop-Item-621750362


As you can see I use a lot reference from http://tyranobuilder.com/tyranoscript-tags-reference/ since it's faster if I copy paste them than type them myself.

So, the logic. As you can see first I make the image appears on screen then I use if-else to check if a variable that I assigned for each items [so if you have a lot items on screen make sure you have the exact same variable for each items plus variable to check if all items have been clicked or not so when user have all items removed they can move on] is 1/true or not. If yes show it, not then do nothing because the code to remove the image will be done on the next label.
After that I just make the if-else into macro to make the code easier to check because now there is another if-else to check if all the items have been clicked or not. So if there is if on if it will be tedious to check all the code.

And here is the full code :
[eval exp="f.gem=1"]
[eval exp="f.loli=1"]
[eval exp="f.check=0"]

[macro name="gem"]
[if exp="f.gem==1"]
[image storage="default/Gem.png" layer=1 page=fore visible=true x="41" y="124" ]
[locate x=41 y=124]
[clickable width=150 height=150 target=*RemoveGem]
[else]
[endif]
[endmacro]

[macro name="loli"]
[if exp="f.loli==1"]
[image storage="default/Lollipop.png" layer=2 page=fore visible=true x="247" y="151" ]
[locate x=247 y=151]
[clickable width=150 height=150 target=*RemoveLoli]
[else]
[endif]
[endmacro]

[if exp="f.check==2"]
[jump storage=scene1.ks target=*MoveOn]
[else]
[gem] [loli]
[endif]

[eval exp="f.gem=0"]
[eval exp="f.check+=1"]
[freeimage layer=1 page=fore]

[eval exp="f.loli=0"]
[eval exp="f.check+=1"]
[freeimage layer=2 page=fore]


You can download the project example here : https://www.mediafire.com/?z6a0o8w82y5la6a
Expand