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

#1 2009-01-02 03:22:35

Rooster1121
Scratcher
Registered: 2008-07-29
Posts: 18

need some help i dont understand...

how do you make a sprite not go through the floor like you can walk and remain on top of the ground with out falling through please help, step by step if possible i need like what bricks and where to put them, any help would be appreciated. thanks.


"i am sure roosters make good pets"

Offline

 

#2 2009-01-02 11:12:32

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: need some help i dont understand...

I am not going to show u bricks, instead tell you the theroy (in detail) so you can do it ure self and learn.
Basicly you want 2 variables, last good x and y and a if/else statment. If your charecter sprite is touching your ground sprite/colour then the the character's X and Y should be set to the variables, last good x and y. in the else, you are going to set your last good x/y to your current x/y. This sould provide you with perfect movment, up/down/left and right.
hope uve lernt!

Offline

 

#3 2009-01-02 12:24:21

pokemon_master12
Scratcher
Registered: 2008-09-26
Posts: 100+

Re: need some help i dont understand...

You need to make the floor a background, not a sprite. Or, if you are trying to make a scrolling background and so you need to use the floor as a sprite, then you have to use this script for the SPRITE:

[blocks]<when green flag clicked>[/blocks]
[blocks]<show>[/blocks]
[blocks]<go to front>[/blocks]

Then your sprite will appear and move in front of everything else on the screen.

Happy Scratch-ing!  wink


My Dragon Egg! http://dragcave.net/image/5YUA.gif
Visit my blog: http://freyasworld.wordpress.com/

Offline

 

#4 2009-01-02 13:21:35

bhz
Scratcher
Registered: 2008-07-06
Posts: 100+

Re: need some help i dont understand...

In the character

<forever>
<if> <touching color[ ground
<change y by( positive #
[/blocks]

Keep the ground the same color.
If the ground is multiple colors, make it a sprite, and do
<touching[ ground sprite
[/blocks]instead of
<touching color[ ground color[/blocks]

Offline

 

#5 2009-01-02 14:12:00

dreamtaker
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: need some help i dont understand...

http://scratch.mit.edu/projects/dreamtaker/369286

this might help


Check out Flare OS!

Offline

 

#6 2009-01-02 14:19:24

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: need some help i dont understand...

Here is what you do, these are the scripts

<forever>
<if><touching[ ground
<change y by( 1 ) or two, it doesn't matter that much

now make a new script:

<forever>
<if> <<  <not>  >><touching[ ground
<change y by( -1 )


These two scripts make the sprite fall if not touching the ground and stay on if he is touching the ground. The first is for staying on and the second is for falling

smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#7 2009-01-03 13:53:57

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: need some help i dont understand...

You could do
<when green flag clicked>
<go to x sad  0 )y sad  0
<repeat until><touching[edge
<change y by( -5
<end>
every time you drag it up, it falls back down. without going through.
hope it helps

Last edited by fg123 (2009-01-03 13:56:36)


Hai.

Offline

 

Board footer