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

#1 2009-12-03 06:43:59

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Touch Edge/New Background/Lose Sprites

Hey guys, I just started a new project after scrapping two previous ones. I decided to not go with a scrolling option so what I have is my character going up stairs towards the right and at the edge I want it so that when he hits it, the next background is shown, and the stairs sprites disappear. What do I do to achieve this?

Offline

 

#2 2009-12-03 06:48:51

06dknibbs
Scratcher
Registered: 2008-01-29
Posts: 1000+

Re: Touch Edge/New Background/Lose Sprites

You could do this by creating sprites called "Exit 1" "Exit 2" etc:

Tell those sprites to "Forever, show. Set Ghost effect to 100%" and then tell your main charecter to broadcast "Exit 1" "Exit 2" etc: Depending on which exit your touching  smile

Then, make all sprites you don't want hide when they receive "Exit 1" and everything you do want shows, with the background changing etc:

If you want, you can download my Dot RPG project and look at the sprites/scripts to see what I mean  smile

Download here  smile


http://i404.photobucket.com/albums/pp129/06dknibbs/Untitled-3-6.jpg

Offline

 

#3 2009-12-03 06:54:01

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: Touch Edge/New Background/Lose Sprites

What's the ghost effects? I only started using this program for a couple days. I haven't used broadcasting yet either.

Thanks. Do you have any instant messaging? I need to get this done by 9:30am or I'm dead. You can try my AIM at Lobo Herrerano, Skype doratheconquistadora

Last edited by Weredawg (2009-12-03 06:58:44)

Offline

 

#4 2009-12-04 08:22:50

justtestingstickman
Scratcher
Registered: 2009-07-04
Posts: 100+

Re: Touch Edge/New Background/Lose Sprites

Weredawg wrote:

What's the ghost effects? I only started using this program for a couple days. I haven't used broadcasting yet either.

Thanks. Do you have any instant messaging? I need to get this done by 9:30am or I'm dead. You can try my AIM at Lobo Herrerano, Skype doratheconquistadora

<ghost> effect is used to create transparency, like a stereotypical ghost. Broadcast means like you're sending a message to the world, and then you can make other sprites respond to that message with the <when I receive[ block



And to help with the original question:
Create a sprite called exit, whenever it touches the player, make it broadcast "next".
DO NOT make it broadcast "exit1" for level 1 and "exit2" for level 2 etc, you're wasting time, effort and memory space. Create a variable called "level". Now create a script saying:
<when I receive[ next
<change{ level }by( 1

Then for the stage or whatever is the level, say
<switch to costume[ <{ level }>
If you number the costumes, or you could:
<if><( <{ level }> <=> 1 )>
<switch to costume[ whatever your costume is called.

There are many many more ways, but this is my second favorite (favorite involves a lot of pen so I won't go into it now).
Also, for the stairs, do something like:
<if><( level <=> number )>
<go to x sad  something )y sad  something





If you aren't comfortable with variables, please ignore this post.

Last edited by justtestingstickman (2009-12-04 08:28:56)


http://img509.imageshack.us/img509/2126/smalladvert.pnghttp://img175.imageshack.us/img175/8867/advertisementfor3sprite.pnghttp://img696.imageshack.us/img696/6061/failc.png
This signature has too many lines.

Offline

 

Board footer