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

#1 2008-11-17 15:14:42

Delocuro
Scratcher
Registered: 2008-11-08
Posts: 10

How to make solid objects

Hey, I can't seem to be able to make solid objects that you can walk on, bump into, you can't jump through, and still have the gravity function work properly. Anyone know how?

Offline

 

#2 2008-11-17 17:38:52

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: How to make solid objects

Basically, you need to detect the fact that your sprite is touching the solid, and prevent the movement from working if they are.

There are lots of different ways of doing this, some look better than others. 

Have a look at my "complex jumping demo" for an example. 

http://scratch.mit.edu/projects/Mayhem/26609


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

Board footer