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

#1 2008-12-14 21:48:55

wordMan
Scratcher
Registered: 2007-12-02
Posts: 82

can some one tell me how to make z position in squeak?

it would be good if you could tell me if it's possible, and if possible whats the code.


http://www.danasoft.com/sig/1024tim.jpg

Offline

 

#2 2008-12-15 01:34:00

AddZero
Scratcher
Registered: 2007-08-11
Posts: 100+

Re: can some one tell me how to make z position in squeak?

Do you mean the sort order of the sprites?
So objects with a higher z (farther back) are behind objects with a lower z? (in front)

Not easily, you can just let sprites to move back or to the front.

But there's tricks to make it work like with a z number.
http://scratch.mit.edu/projects/Paddle2See/330704


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#3 2008-12-15 13:29:48

wordMan
Scratcher
Registered: 2007-12-02
Posts: 82

Re: can some one tell me how to make z position in squeak?

AddZero wrote:

Do you mean the sort order of the sprites?
So objects with a higher z (farther back) are behind objects with a lower z? (in front)

Not easily, you can just let sprites to move back or to the front.

But there's tricks to make it work like with a z number.
http://scratch.mit.edu/projects/Paddle2See/330704

thanks but what i meant was to make a block that works for z pos.


http://www.danasoft.com/sig/1024tim.jpg

Offline

 

#4 2008-12-15 20:40:47

AddZero
Scratcher
Registered: 2007-08-11
Posts: 100+

Re: can some one tell me how to make z position in squeak?

Ok, then what do you mean by z position?
What are you trying to do?  Are you trying to do 3d?

Scratch is designed for 2d.  So you have x and y.  You can fake 3d, or the z position and the camera position using tricks.  (All Computer 3d is tricks anyway, your computer screen is flat 2d.)
Several of my projects do this, and there's others.
Let me know exactly what you're trying to do and I may be able to help.


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#5 2008-12-15 23:10:31

wordMan
Scratcher
Registered: 2007-12-02
Posts: 82

Re: can some one tell me how to make z position in squeak?

AddZero wrote:

Ok, then what do you mean by z position?
What are you trying to do?  Are you trying to do 3d?

Scratch is designed for 2d.  So you have x and y.  You can fake 3d, or the z position and the camera position using tricks.  (All Computer 3d is tricks anyway, your computer screen is flat 2d.)
Several of my projects do this, and there's others.
Let me know exactly what you're trying to do and I may be able to help.

i have squeak and i wanted to know the code to make a z position


http://www.danasoft.com/sig/1024tim.jpg

Offline

 

#6 2008-12-16 10:38:31

AddZero
Scratcher
Registered: 2007-08-11
Posts: 100+

Re: can some one tell me how to make z position in squeak?

That's cool.  Again, what do you mean by z position?
What are you going to do with that z position? 
You can make a "z" variable on the sprite how it is.

Again, Scratch is designed for 2d... you can probably make [Change by z] blocks and a (z) variable... By studying the other movement blocks, and copying it, renaming it to z, and taking out the movement code, and just make it change a z position variable.  (but i've never done that before.)

But by itself you'll just have a z variable, hard coded into your own version of scratch that's not compatible with normal scratch projects.

Do you want the z position to do something?  You can do that without hacking scratch.
When the z position is higher, what will it do?
-Will that sprite go behind other sprites?
-Will it get smaller so it looks like it's going into the distance?
-Both?

If so, you're trying to do 3d.  Which is cool.  I can try to help you if I know what you're trying to do.

Last edited by AddZero (2008-12-16 10:40:26)


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#7 2008-12-16 22:25:49

big-bang
Scratcher
Registered: 2008-02-21
Posts: 1000+

Re: can some one tell me how to make z position in squeak?

AddZero wrote:

That's cool.  Again, what do you mean by z position?
What are you going to do with that z position? 
You can make a "z" variable on the sprite how it is.

Again, Scratch is designed for 2d... you can probably make [Change by z] blocks and a (z) variable... By studying the other movement blocks, and copying it, renaming it to z, and taking out the movement code, and just make it change a z position variable.  (but i've never done that before.)

But by itself you'll just have a z variable, hard coded into your own version of scratch that's not compatible with normal scratch projects.

Do you want the z position to do something?  You can do that without hacking scratch.
When the z position is higher, what will it do?
-Will that sprite go behind other sprites?
-Will it get smaller so it looks like it's going into the distance?
-Both?

If so, you're trying to do 3d.  Which is cool.  I can try to help you if I know what you're trying to do.

I really think that the layer function will help you out. Of course, that's probably blindingly obvious... another good thing is to use the size function in accordance to the up/down arrow keys.


http://i47.tinypic.com/6edrbm.jpghttp://i45.tinypic.com/dw9hmw.jpghttp://i50.tinypic.com/f28tvn.jpghttp://i45.tinypic.com/ruwaop.jpg

Offline

 

#8 2008-12-18 17:19:11

wordMan
Scratcher
Registered: 2007-12-02
Posts: 82

Re: can some one tell me how to make z position in squeak?

AddZero wrote:

That's cool.  Again, what do you mean by z position?
What are you going to do with that z position? 
You can make a "z" variable on the sprite how it is.

Again, Scratch is designed for 2d... you can probably make [Change by z] blocks and a (z) variable... By studying the other movement blocks, and copying it, renaming it to z, and taking out the movement code, and just make it change a z position variable.  (but i've never done that before.)

But by itself you'll just have a z variable, hard coded into your own version of scratch that's not compatible with normal scratch projects.

Do you want the z position to do something?  You can do that without hacking scratch.
When the z position is higher, what will it do?
-Will that sprite go behind other sprites?
-Will it get smaller so it looks like it's going into the distance?
-Both?

If so, you're trying to do 3d.  Which is cool.  I can try to help you if I know what you're trying to do.

you can't change the blocks i tried it, doesn't work so far,... :^(


http://www.danasoft.com/sig/1024tim.jpg

Offline

 

#9 2009-02-05 00:41:05

bingbongwong01
Scratcher
Registered: 2009-02-04
Posts: 8

Re: can some one tell me how to make z position in squeak?

Can someone tell me how to change the size of a sprite while gliding? hmm

Offline

 

#10 2009-02-05 06:03:53

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: can some one tell me how to make z position in squeak?

bingbongwong01 wrote:

Can someone tell me how to change the size of a sprite while gliding? hmm

This probably belongs in it's own topic, since it's not really related to the previous discussions.  But let me see if I can help here.  You could maybe set up a forever loop that sets the size to something related to the X or Y position on the screen.  I'm a little short on time right now or I'd make you a sample project.  Let me know if you want one.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer