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

#1 2011-01-21 21:28:31

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Floor?

Im trying to make my sprite stand on the floor and be able to move around and stuff but he keeps vibrating up and down. My current code is

when flag clicked
           forever
                        if color brown is touching color black
                                    change y to 5

please help

Offline

 

#2 2011-01-21 21:34:47

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Re: Floor?

Oh and also how do i make it so that you cant double jump?

Offline

 

#3 2011-01-21 22:18:37

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Floor?

If the sprite isn't supposed to be at y 5, then it'll vibrate - could you upload the unfinished project so we could have a look?

And for the double jump - make a variable. Set it to one at the beginning of the jump and zero when it's done. Make the sprite only jump if the variable equals zero.


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#4 2011-01-21 22:22:08

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

Re: Floor?

To decrease the vibration, make that change y by 1 instead of 5.

Or better yet, do this:
http://i56.tinypic.com/10f6ouo.gif
For maximum slope detection and minimal vibration.

Last edited by Kileymeister (2011-01-21 22:25:15)


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

 

#5 2011-01-21 23:38:14

jazed13
Scratcher
Registered: 2011-01-14
Posts: 20

Re: Floor?

Even Better Yet Change Y By 0.1 Smarrt Ehhh


Subscribe To The Scratch Tuturial Groups's Channel! http://www.youtube.com/user/Jazed13?feature=mhum
http://i1199.photobucket.com/albums/aa463/Jazed14/Subscribe.pnghttp://i1199.photobucket.com/albums/aa463/Jazed14/aspoKWEJ.gif

Offline

 

#6 2011-01-22 11:07:45

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Re: Floor?

Okay, i uploaded it. It's titled First game, unfinished 1

Offline

 

#7 2011-01-22 11:44:20

ian528
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Floor?

Did you try: if touching floor, set y to 0?
Also try this for the jump: if touching floor, then (insert jump script here).
wink

Offline

 

#8 2011-01-22 12:11:50

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Re: Floor?

ian528 wrote:

Did you try: if touching floor, set y to 0?
Also try this for the jump: if touching floor, then (insert jump script here).
wink

Why would i set y to 0?

Oh and also i screwed everything up somehow because i tried to make it when he's standing still it looks like hes breathing. Can someone check my script and tell me how to fix it?

First Game, unfinished 2

Offline

 

#9 2011-01-22 12:25:25

ian528
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Floor?

Nano511 wrote:

ian528 wrote:

Did you try: if touching floor, set y to 0?
Also try this for the jump: if touching floor, then (insert jump script here).
wink

Why would i set y to 0?

Oh and also i screwed everything up somehow because i tried to make it when he's standing still it looks like hes breathing. Can someone check my script and tell me how to fix it?

First Game, unfinished 2

You would set y to 0 because so he won't bounce up and down when he is touching the floor.
I also think you need costumes to animate breathing.

Last edited by ian528 (2011-01-22 12:25:44)

Offline

 

#10 2011-01-22 14:29:56

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Re: Floor?

ian528 wrote:

Nano511 wrote:

ian528 wrote:

Did you try: if touching floor, set y to 0?
Also try this for the jump: if touching floor, then (insert jump script here).
wink

Why would i set y to 0?

Oh and also i screwed everything up somehow because i tried to make it when he's standing still it looks like hes breathing. Can someone check my script and tell me how to fix it?

First Game, unfinished 2

You would set y to 0 because so he won't bounce up and down when he is touching the floor.
I also think you need costumes to animate breathing.

but 0 y is like, in the middle of the screen. And i do have costumes.

Offline

 

#11 2011-01-22 14:36:10

ian528
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Floor?

Oh, no, I meant this:<set y to( 0 )
wink

Last edited by ian528 (2011-01-22 14:37:38)

Offline

 

#12 2011-01-22 14:54:32

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Re: Floor?

No, it diddnt work. I'de really like someone to take a look at my scripts. Im uploading a 3rd update so you can see whats wrong

Offline

 

#13 2011-01-22 14:56:47

ian528
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Floor?

Nano511 wrote:

No, it diddnt work. I'de really like someone to take a look at my scripts. Im uploading a 3rd update so you can see whats wrong

Well, at least he is not vibrating!
wink

Offline

 

#14 2011-01-22 16:30:41

Nano511
Scratcher
Registered: 2011-01-20
Posts: 39

Re: Floor?

Heh, i gave up on this project. Thanks for all your help and stuff, but i diddnt think it was going anywhere  hmm

Offline

 

Board footer