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

#1 2012-08-27 13:40:16

ArloarLoLs
Scratcher
Registered: 2012-08-27
Posts: 71

Stamping covered by other sprites

Hello, I'm making a 3D game by stamping, but the stamps are covered by other sprites behind the stamper. I did make the stamper go to front, but the stamps wont go to front. See my project here: http://scratch.mit.edu/projects/ArloarLoLs/2748722

When the car is on the race track(other sprites), the race track overs the stamps the car makes, please take a look at my project's scratch blocks and post a helpful reply.

Thanks you.  smile

Offline

 

#2 2012-08-27 14:48:04

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Stamping covered by other sprites

Unfortunately stamps only cover the background, all sprites will cover them.


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-08-27 15:04:28

ArloarLoLs
Scratcher
Registered: 2012-08-27
Posts: 71

Re: Stamping covered by other sprites

zammer990 wrote:

Unfortunately stamps only cover the background, all sprites will cover them.

So is there any way to fix this?

Offline

 

#4 2012-08-27 15:20:47

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Stamping covered by other sprites

ArloarLoLs wrote:

zammer990 wrote:

Unfortunately stamps only cover the background, all sprites will cover them.

So is there any way to fix this?

The only way is to stamp the sprites too.  This is actually easier to do as a 1s1s since the order in which you stamp them is important, and when you want things to run sequentially, 1s1s is great!


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-08-27 15:42:33

ArloarLoLs
Scratcher
Registered: 2012-08-27
Posts: 71

Re: Stamping covered by other sprites

MoreGamesNow wrote:

ArloarLoLs wrote:

zammer990 wrote:

Unfortunately stamps only cover the background, all sprites will cover them.

So is there any way to fix this?

The only way is to stamp the sprites too.  This is actually easier to do as a 1s1s since the order in which you stamp them is important, and when you want things to run sequentially, 1s1s is great!

What does 1s1s mean?

Offline

 

#6 2012-08-27 16:14:16

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Stamping covered by other sprites

ArloarLoLs wrote:

MoreGamesNow wrote:

ArloarLoLs wrote:


So is there any way to fix this?

The only way is to stamp the sprites too.  This is actually easier to do as a 1s1s since the order in which you stamp them is important, and when you want things to run sequentially, 1s1s is great!

What does 1s1s mean?

1 sprite, 1 script  wink


http://i48.tinypic.com/2072ctw.gif

Offline

 

#7 2012-08-27 17:19:52

ArloarLoLs
Scratcher
Registered: 2012-08-27
Posts: 71

Re: Stamping covered by other sprites

powerpoint56 wrote:

ArloarLoLs wrote:

MoreGamesNow wrote:


The only way is to stamp the sprites too.  This is actually easier to do as a 1s1s since the order in which you stamp them is important, and when you want things to run sequentially, 1s1s is great!

What does 1s1s mean?

1 sprite, 1 script  wink

Ok, so i duplicate the sprite?

Offline

 

#8 2012-08-27 17:48:33

thebriculator
Scratcher
Registered: 2011-07-11
Posts: 500+

Re: Stamping covered by other sprites

no, you combine the sprites into one. it can be very complicated
(see the wiki)


.     http://tiny.cc/2cwgpw    http://tiny.cc/viwgpw    http://tiny.cc/iwwgpw

Offline

 

#9 2012-08-27 17:54:12

yuxuan
Scratcher
Registered: 2010-04-01
Posts: 3

Re: Stamping covered by other sprites

thebriculator wrote:

no, you combine the sprites into one. it can be very complicated
(see the wiki)

Wow thats really complicated.

Offline

 

#10 2012-08-27 21:54:50

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Stamping covered by other sprites

Well, it doesn't have to be only one sprite and one script.  You can create a sequence of broadcasts that avoids multi-threading (having multiple scripts run at the same time).  You would just use a bunch of "broadcast and wait" commands to break up a large script into several smaller scripts, possibly across multiple sprites.  This can function identically to a 1s1s project.

Last edited by amcerbu (2012-08-27 21:55:33)

Offline

 

#11 2012-08-27 22:32:29

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Stamping covered by other sprites

amcerbu wrote:

Well, it doesn't have to be only one sprite and one script.  You can create a sequence of broadcasts that avoids multi-threading (having multiple scripts run at the same time).  You would just use a bunch of "broadcast and wait" commands to break up a large script into several smaller scripts, possibly across multiple sprites.  This can function identically to a 1s1s project.

True.  The nice thing about "broadcast and wait" is that your scripts will still run sequentially.

[/response]

The more you practice at combining sprites into one, the easier it gets.  The most straight-forward approach is to have a ton of variables that store what each sprite would originally store, and then render each sprite as normal (see below).  A list can make things easier (or more complex  hmm ).  Of course, it is a little trickier than that for most projects (for instance, storing all the costumes means that the costume's numbers get messed up).  As amcerbu pointed out, you can use multiple sprites to break things into simpler chunks and keep costume numbers the same, but in the end you'll be doing about the same thing: breaking all rendering into a specific order and then stamping images in that order.

set [sprite1 x v] to (100)
set [sprite2 costume # v] to (4)
set [sprite 6 y v] to (-45)
go to x:(sprite1 x) y:(sprite1 y)
point in direction (sprite1 direction)
switch to costume (sprite1 costume)
stamp
go to x:(sprite2 x) y:(sprite2 y)
point in direction (sprite2 direction)
switch to costume (sprite2 costume)
stamp


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#12 2012-08-28 05:36:41

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: Stamping covered by other sprites

MoreGamesNow wrote:

ArloarLoLs wrote:

zammer990 wrote:

Unfortunately stamps only cover the background, all sprites will cover them.

So is there any way to fix this?

The only way is to stamp the sprites too.  This is actually easier to do as a 1s1s since the order in which you stamp them is important, and when you want things to run sequentially, 1s1s is great!

But 1s1s projects make the script REALLY long and hard to follow. I find it easier to have one sprite, and several scripts for different purposes and one main script with a bunch of broadcast and wait blocks in it. When there is a lot of scripts I make more sprites and put different scripts in different sprites depending on what they are for.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#13 2012-08-28 09:01:45

ArloarLoLs
Scratcher
Registered: 2012-08-27
Posts: 71

Re: Stamping covered by other sprites

amcerbu wrote:

Well, it doesn't have to be only one sprite and one script.  You can create a sequence of broadcasts that avoids multi-threading (having multiple scripts run at the same time).  You would just use a bunch of "broadcast and wait" commands to break up a large script into several smaller scripts, possibly across multiple sprites.  This can function identically to a 1s1s project.

So one sprite is going to get separate with by scripts running at the same time from 2 threads? (Broadcasting)

Offline

 

Board footer