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

#1 2011-03-11 22:47:48

tomvtv
New Scratcher
Registered: 2011-01-04
Posts: 1

Help with project

Hello
I'm fairly new to scratch (in my opinion anyway), so forgive me ifI amke any mistakes in this post.

I need help with my project called Aster-Run
http://scratch.mit.edu/projects/tomvtv/1579864
Basically, the premise is, you fly from one side of the screen to the other with out geting hit by the asteroids. Its not the longest game in existance and certainly not the best, but I have enjoyed making and playing it.

Here is my problem: each individual asteroid uses its own sprite and there are a lot of asteroids, meaning there are quite a lot of sprites which are essentially the same as each other. My question is, is there a way to have all of the asteroids represented by, if not one then at maximum three sprites (one for the large asteroids, one for the smaller asteroids and one for the single asteroid the final boss uses). Does anyone know how or even if it is possible to duplicate a sprite whilst having each duplication move at different speeds on different areas of the screen.

I don't mind if you have to rid of the costume switching, but to be useful, the duplicates would have to have the same or similar properties as my current asteroids, even if it involves ridiculously complex scripting.

Thanks in advance for helping.

Offline

 

#2 2011-03-13 17:39:32

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: Help with project

There is not a way to duplicate sprites in scratch, although you could use panther.

Offline

 

#3 2011-03-13 18:58:35

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: Help with project

Although scratch does not have a simple cloner, stamping is used by advanced scratchers to make it appearer that there's multiple sprites. Stamping use the pen block, stamp and the clear block. The stamp block will 'paint' an image of the sprite onto the stage. The image can't move, but if you clear and stamp fast enough it could look like it's moving.
~ SSBBM


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#4 2011-03-13 19:00:10

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: Help with project

YourLocalBlockLib wrote:

Although scratch does not have a simple cloner, stamping is used by advanced scratchers to make it appearer that there's multiple sprites. Stamping use the pen block, stamp and the clear block. The stamp block will 'paint' an image of the sprite onto the stage. The image can't move, but if you clear and stamp fast enough it could look like it's moving.
~ SSBBM

Yes, that works too.

Offline

 

#5 2011-03-13 19:02:22

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Help with project

Yes, you can make one sprite, within one script loop, clear the ink on the stage, move to a certain place, stamp, move to another place and stamp there.  Doing this repeatedly gives the illusion of having two sprites.

Rest assured this is quite possible, even with more than two clones.

I'll write up a script for storing the data of each "clone" so they can move as well.  Give me a second.

Last edited by Kileymeister (2011-03-13 19:03:52)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#6 2011-03-13 19:14:39

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Help with project

Ok, here:  For example this script encapsulates both Sprite8 and Sprite9:
http://i53.tinypic.com/oi5ait.gif
As you can see, it uses lists.  At the top it gets fed the starting data; two entries for XPosition (one for each sprite) and two for YPosition (again, one for each).  You can add more starting entries; always add one XPosition and one YPosition (always make YPositions' 212).  In this one the starting entries for X are -180 and -155, so that's where the asteroids are going to fall.

Now, there are limits to cloning.  Every time you add another sprite (consisting of a new X and Y entry), you must add in this piece to the script:
http://i51.tinypic.com/zlrrwo.gif
This segment is each individual sprite's behavior (this makes them fall down and go back when they hit the ground.)

So, say you have 3 clones (consisting of 3 X and 3 Y entries), you would need that segment to be in the script 3 times, and so on.

Last edited by Kileymeister (2011-03-13 19:15:19)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

Board footer