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

#1 2009-08-02 18:40:25

Grue
Scratcher
Registered: 2009-08-02
Posts: 18

How do I make a physics engine?

I got my character to move left and right and jump but how do I get the character to fall slowly?

Offline

 

#2 2009-08-03 06:28:13

Mozaz
Scratcher
Registered: 2009-05-19
Posts: 500+

Re: How do I make a physics engine?

I take it you've got a sprite for the ground. Basically you want to have a script like this:

Forever
     if not touching sprite [ ]
           change y by [ 1 ]
End

That will make it so that whenever the sprite isn't touching the ground sprite, it will fall by 1. You just need to make it so that when the sprite jumps, its y increase is higher than 1.

Hope that helped  smile


http://i33.tinypic.com/15i5fmp.png

Offline

 

#3 2009-08-03 12:04:04

spoonmirror
Scratcher
Registered: 2009-08-03
Posts: 1

Re: How do I make a physics engine?

Thanks.

Offline

 

#4 2009-08-03 12:14:59

Grue
Scratcher
Registered: 2009-08-02
Posts: 18

Re: How do I make a physics engine?

Thank you!

Offline

 

#5 2009-08-03 13:06:16

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: How do I make a physics engine?

http://scratch.mit.edu/forums/viewtopic.php?id=16077 That will give you more information on the subject  smile


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

Board footer