This is very simple, probably anyone could help me with this.
I'm making a game called The Ice Cream Maker where, well, you make your own ice cream. Okay, so first you select a cone. When you first select the one, you pick two scoop flavors and then drag toppings.
My question: once the player has dragged their desired toppings to the ice cream, how can I make the rest of the unchosen toppings disappear? Any ideas?
I could always make the toppings stay there and just make a title saying you're done, but you could still drag toppings... It would be much better if I could make all toppings that aren't on your ice cream disappear, so all you can see is your finished ice cream creation and the title.
Any help is appreciated!
Offline
I know. Make a done button or something and make a variable called toppings. Set toppings to 0. For the script that allows the toppings to be added, say change toppings by 1 in that script. The done button, yes, say if When Flag Clicked forever if toppings = 0 or toppings > 0 and mouse down and touching mouse pointer broadcast done. For all the toppings say When i receive done hide.
This may or may not work. It would be much helpful with the game uploaded .
Offline
On all of the topping sprites you want a script that is:
When green flag
forever
if
touching (icecream)
broadcast "hide toppings"
stop script
and also
when I receive "hide toppings"
hide
Hope that helps! If you need any questions just ask!
Offline
To stop the sprites from being able to be dragged, use the stop all block or hide them.
Offline
jji7skyline wrote:
To stop the sprites from being able to be dragged, use the stop all block or hide them.
Why stop all? That means to stop the game
Offline
These are all helpful. I'll try each one and post the one that works the best for me! Thanks.
Offline
@TheBajeebas :: Your scripts made perfect sense, though I changed "When flag clicked" to "When I recieve 'finished'". ('finished' is broadcasted by clicking the 'Done' button.)
The only problem with it, is when any toppings broadcast "hidetoppings" they also have the script "When I recieve 'hidetoppings - hide" so that ALL toppings hide, no matter what...
Is there some way to get around this? Some way to change the code so that "When I recieve 'hidetoppings' - hide" only affects unselected toppings?
@Thescratch3 :: I'll try your script next!
Offline
YESSS!! Sorry for the excitement, but I figured it out! Ok, ignore the post above. Here is the script I created and worked perfectly:
When I recieve "finished"
forever if < not < touching Sprite40 > or < touching Sprite 5 > >
hide
In simpler terms, when the Done button is clicked and 'finished' is broadcasted, any toppings that are not touching the ice cream will hide.
Offline
DewleafWolf wrote:
@TheBajeebas :: Your scripts made perfect sense, though I changed "When flag clicked" to "When I recieve 'finished'". ('finished' is broadcasted by clicking the 'Done' button.)
The only problem with it, is when any toppings broadcast "hidetoppings" they also have the script "When I recieve 'hidetoppings - hide" so that ALL toppings hide, no matter what...
Is there some way to get around this? Some way to change the code so that "When I recieve 'hidetoppings' - hide" only affects unselected toppings?
@Thescratch3 :: I'll try your script next!
Hm... you could try setting a local variable like "placed" for each sprite to 0 by default, then if you have placed that sprite, set "placed" to 1 and modify the broadcast receiver hat block a little, like this:
When I receive hidetoppings if placed = 0 hide
Edit: Oops, never mind. Looks like you figured it out.
Last edited by Harakou (2011-07-19 17:06:41)
Offline
DewleafWolf wrote:
YESSS!! Sorry for the excitement, but I figured it out! Ok, ignore the post above. Here is the script I created and worked perfectly:
When I recieve "finished"
forever if < not < touching Sprite40 > or < touching Sprite 5 > >
hide
In simpler terms, when the Done button is clicked and 'finished' is broadcasted, any toppings that are not touching the ice cream will hide.
Nice job! Please let me know when you are done and give me the URL. Also click my sig!
Offline
I will be sure to let you know when it's done! I'm almost finished with it; probably will be done in a day or two.
Offline
The project is done! Go to my projects and try it out... I have a few others that are almost done. I know it has a few problems, but it's my first project that I've finished!
Offline