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

#1 2011-10-18 20:16:25

Hammerton
Scratcher
Registered: 2011-10-16
Posts: 16

Making Sprite land on things

I have done this thing before, but it was a long time ago, so could someone remind me how you make a sprite land on an object suspended in the air?

Offline

 

#2 2011-10-19 15:43:24

astroLoger
New Scratcher
Registered: 2011-10-16
Posts: 100+

Re: Making Sprite land on things

You mean like in a platformer?

Well if you do, once the object collides with the platform, set a timer for 1 sec or something similar if it is jumping upwards and then change a variable to something that causes gravity to come into play and the object to become solid. If it is falling, just have that already turned on.
This was probably rather ill-formed because I don't know what you mean exactly, but it should work in theory if you know how to do gravity.

Offline

 

#3 2011-10-19 16:52:59

Hammerton
Scratcher
Registered: 2011-10-16
Posts: 16

Re: Making Sprite land on things

astroLoger wrote:

You mean like in a platformer?

Well if you do, once the object collides with the platform, set a timer for 1 sec or something similar if it is jumping upwards and then change a variable to something that causes gravity to come into play and the object to become solid. If it is falling, just have that already turned on.
This was probably rather ill-formed because I don't know what you mean exactly, but it should work in theory if you know how to do gravity.

Yes I am talking about making a sprite land on a set platform in the air, the only problem with your theory is that I don't want the variable showing all the time.  Does that even make any sense? :-)

Offline

 

#4 2011-10-20 07:03:42

astroLoger
New Scratcher
Registered: 2011-10-16
Posts: 100+

Re: Making Sprite land on things

Hammerton wrote:

astroLoger wrote:

You mean like in a platformer?

Well if you do, once the object collides with the platform, set a timer for 1 sec or something similar if it is jumping upwards and then change a variable to something that causes gravity to come into play and the object to become solid. If it is falling, just have that already turned on.
This was probably rather ill-formed because I don't know what you mean exactly, but it should work in theory if you know how to do gravity.

Yes I am talking about making a sprite land on a set platform in the air, the only problem with your theory is that I don't want the variable showing all the time.  Does that even make any sense? :-)

Sure, if you mean like the number in the right corner next to the variable, click the box next to the variable in the Variables and then you won't see it in the game. That is what I do.

Offline

 

#5 2011-10-20 12:35:34

Hammerton
Scratcher
Registered: 2011-10-16
Posts: 16

Re: Making Sprite land on things

K, just thought that disabled the entire variable, but thanks for the explanation.

Offline

 

Board footer