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

#1 2011-01-23 13:21:41

the_storm_of_stone
Scratcher
Registered: 2011-01-22
Posts: 24

Quicksand?

Hi again,

I'm experimenting with different things my character can walk on. I thought quicksand would be interesting. I've scripted it so that the character's movement is much slower than on ordinary ground, but I'm unsure how to get the quicksand to "suck in" the character, like in Super Mario Bros. DS or Wii.

Would anyone be so kind as to suggest anything?
smile

Offline

 

#2 2011-01-23 17:12:34

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

Re: Quicksand?

You could try something like:

[forever]
[][if <touching color [ ]?>]
[][][set y to [-1]]
[][else]
[][][set y to [0]]
[][end if else]
[end forever]


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

Offline

 

#3 2011-01-23 17:58:42

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Quicksand?

Jonathanpb wrote:

You could try something like:

[forever]
[][if <touching color [ ]?>]
[][][set y to [-1]]
[][else]
[][][set y to [0]]
[][end if else]
[end forever]

I think you mean [change y by [-1]].


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#4 2011-01-24 12:42:48

the_storm_of_stone
Scratcher
Registered: 2011-01-22
Posts: 24

Re: Quicksand?

Do you mean the colour is the colour of the quicksand?

I tried it with if the character was touching the quicksand then change y to minus 1, else change y by 0, but the character wouldn't move left or right and ended up standing below the ground line.

Offline

 

#5 2011-01-24 17:49:53

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

Re: Quicksand?

AtomicBawm3 wrote:

Jonathanpb wrote:

You could try something like:

[forever]
[][if <touching color [ ]?>]
[][][set y to [-1]]
[][else]
[][][set y to [0]]
[][end if else]
[end forever]

I think you mean [change y by [-1]].

The character would sink and sink and sink as long as long as it were touching the color. I though the quicksand was just supposed to sink you in a little bit  tongue

the_storm_of_stone wrote:

Do you mean the colour is the colour of the quicksand?

I tried it with if the character was touching the quicksand then change y to minus 1, else change y by 0, but the character wouldn't move left or right and ended up standing below the ground line.

Yeah, the color of the quicksand.

Uh... I thought you wanted the character to sink in a little bit - doesn't it do that?  tongue

I don't see how your character would not be able to move... maybe you have a [forever] or [forever if < >] block in the same script as the movement part?


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

Offline

 

#6 2011-01-25 11:56:34

the_storm_of_stone
Scratcher
Registered: 2011-01-22
Posts: 24

Re: Quicksand?

Yeah, I wanted the character to get sucked down completely while still being able to move left and right, but still be able to jump out of it.

Could you please describe the inclusion of the forever or forever if more clearly? I'm not particularly skilled at programming, so I'm afraid you'll have to explain as clearly as you can.... Sorry  smile

Offline

 

#7 2011-01-25 19:26:42

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Quicksand?

forever
if touching "color of quicksand"
change y by 2 (or however fast you want)

Offline

 

#8 2011-01-26 00:52:29

the_storm_of_stone
Scratcher
Registered: 2011-01-22
Posts: 24

Re: Quicksand?

Okay, but how do I stop him going below the grounds surface when I get out of it?

Offline

 

Board footer