This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-10-20 18:46:53

Bleach_Fanatic16
New Scratcher
Registered: 2010-10-19
Posts: 6

What do i do after level change?

im able to change the level, but how do i make the character dissapear once the game is over?? im seriously confused here.. sorry for being such a noob lol. help would kindly be appreciated

Offline

 

#2 2010-10-20 20:54:40

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: What do i do after level change?

You want the character to hide after you finish the last level? Not too hard - You probably have a script or portion of a script that moves the spite once you finish a level. At the very beginning of that portion, put an if block that checks to see if you're on the last level, and if you are, it hides the sprite and ends the script. Also, you can put a broadcast that broadcasts that you've won. (optional) Your script might look something like this:

Code:

If level = (last)
    broadcast Win
    hide
    End Script
EndIf

Hope that makes sense.  smile


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2010-10-20 21:17:20

Bleach_Fanatic16
New Scratcher
Registered: 2010-10-19
Posts: 6

Re: What do i do after level change?

do i put it on the sprite script?

Offline

 

#4 2010-10-20 21:29:13

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: What do i do after level change?

Well, actually, to hide the object, there is a block called "hide" in the looks section. Just use that in your ending script!  smile


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#5 2010-10-20 21:46:32

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: What do i do after level change?

Bleach_Fanatic16 wrote:

do i put it on the sprite script?

What do you mean? Just add that script bit into your original script.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2010-10-20 23:14:02

Telemachus
Scratcher
Registered: 2010-04-21
Posts: 500+

Re: What do i do after level change?

First make sure that you actually have a level variable, so that you can keep track of which level is the last. If you are switching levels by broadcast, just have the level variable increase after each level is completed through the broadcast. After the last level is finished, you can make the character hide using a script similar to that displayed by Harakou.  smile


http://i54.tinypic.com/10h0fnp.jpg

Offline

 

#7 2010-10-21 17:50:17

Bleach_Fanatic16
New Scratcher
Registered: 2010-10-19
Posts: 6

Re: What do i do after level change?

im still a bit confused... im sorry for the trouble.

Offline

 

#8 2010-10-22 01:27:49

2l84zwamani
Scratcher
Registered: 2010-09-27
Posts: 100+

Re: What do i do after level change?

Bleach_Fanatic16 wrote:

im still a bit confused... im sorry for the trouble.

First make a variable called "Level", so you can make the background switch and such, anyway, I'll just show you what you can do  with "Level", if your game is a "usual" game:
<when green flag clicked><forever if><touching[ goal<change{  Level}by( 1<go to x sad   )y sad 

etcetera

Then you need to put this script in the main sprite, if let's say the last level of the game is Level 10:

<when green flag clicked><forever if><( <{ Level }> <=> 10 )><hide><end>

Anyway, what don't you get? Harakou said everything. (Mwahahahahahaha I am just repeating what he/she said)


I will be a Ms. Pickle Dr. Deadpebble Great Person <forever>
http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3 GROB THE SLIME WILL TAKE OVER THE WORLD!

Offline

 

#9 2010-10-22 01:41:43

2l84zwamani
Scratcher
Registered: 2010-09-27
Posts: 100+

Re: What do i do after level change?

OMG WHOOPS!

<when green flag clicked>
<forever if><( <{ Level }> <=> 10 )>
<hide><end>


I will be a Ms. Pickle Dr. Deadpebble Great Person <forever>
http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3 GROB THE SLIME WILL TAKE OVER THE WORLD!

Offline

 

#10 2010-10-22 16:06:01

Bleach_Fanatic16
New Scratcher
Registered: 2010-10-19
Posts: 6

Re: What do i do after level change?

my teacher didnt explain it to me. i got it now. thank u so much!!  big_smile

Offline

 

Board footer