Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » help with scripts
- 14ivantm
-
7 posts
help with scripts
I'm making a game for school and it does't work the way I want it to. I wanted when the penguin is clicked, for the screen to go a background I made and when it is not clicked for the lives sprite to change a costume to a less life and when there are no lives for a background to pop up with you lose. I already made all the sprites and backgrounds. Also, the background is constantly switching backdrops until you win or lose. I've tried playing around with it but I can't figure it out. Can someone help me? The project is called the nearly impossible game by 14ivantm. Thanks.
- Sonickyle
-
1000+ posts
help with scripts
Would you mind if you share the project here so we can find out what's wrong with it?
No I don't make projects anymore. I left some time ago.
I only check the forums every now and then, but other than that consider me retired.
I only check the forums every now and then, but other than that consider me retired.
- drmcw
-
1000+ posts
help with scripts
You have 2 different lives variables. There should be just one global one.
Last edited by drmcw (Oct. 10, 2013 17:00:00)
- scubajerry
-
1000+ posts
help with scripts
You have made 2 sprite specific Lives variables. Do the following I can't figure out how to share it. Sorry.
Delete the variables from both sprites.
Create a new variable lives (all lower case)
Make sure this variable is being used everywhere (drag and drops, and pull downs)
There shouldn't be a uppercase Lives anywhere.
- 14ivantm
-
7 posts
help with scripts
i followed your advice and now the background switch but not continuously and the lives don't change costumes when there is one less life you also win automatically, it is too fast
- scubajerry
-
1000+ posts
help with scripts
So in sprite 1, the switch costume commands have the wrong costume names in them. They have to have either numbers (1,2,3,…) or the real names from the pull downs.
Also I changed Penguin1 in this remix. http://scratch.mit.edu/projects/13139044/ Do the changes make sense?
Also I changed Penguin1 in this remix. http://scratch.mit.edu/projects/13139044/ Do the changes make sense?
Last edited by scubajerry (Oct. 11, 2013 02:31:23)
- 14ivantm
-
7 posts
help with scripts
thanks for your help @scubajerry but i still have more issues, like first it says you win and then 2 seconds later it says you lose could you please help me figure it out?
- scubajerry
-
1000+ posts
help with scripts
thanks for your help @scubajerry but i still have more issues, like first it says you win and then 2 seconds later it says you lose could you please help me figure it out?
In Penguin1 after the the
stop [other scripts in sprite v]
// add
broadcast [Game over v]
wait (2) secs //this is optional
stop [this script v]
Last edited by scubajerry (Oct. 11, 2013 03:45:03)
- scubajerry
-
1000+ posts
help with scripts
Also - your PLAY AGAIN costume has a white horizontal line in the upper left hand corner that I suspect you don't want.
- dandilon
-
1 post
help with scripts
hi i am a new user can somebody tell me how to use this thing.
- scubajerry
-
1000+ posts
help with scripts
Welcome hi i am a new user can somebody tell me how to use this thing.
What thing?
- 14ivantm
-
7 posts
help with scripts
thanks for all your help but i have one more question, how can i make if you win, the background to change to a background i have for winning and vice versa for losing.
- scubajerry
-
1000+ posts
help with scripts
It appears to already do this. thanks for all your help but i have one more question, how can i make if you win, the background to change to a background i have for winning and vice versa for losing.
- Discussion Forums
- » Help with Scripts
-
» help with scripts