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

#1 2011-07-13 22:50:55

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

I need some physics ;_;

I want to make a game kinda like red remover and super stackers and all of those games but I kind of need some box physics. I tried searching "box physics", but alas I had no success :c

Helpies?


3

Offline

 

#2 2011-07-13 22:54:57

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

Re: I need some physics ;_;

Scratch is kind of limited for those kind of physics, but I suppose you can put sensors on each side of a box's bottom (preferably switch-to costume sensors instead of sprite sensors so each box doesn't need more sprites), and make them check if they are touching the level. 

If one is touching and the other is not, turn towards the sensor that is not touching.
If both are touching, change x velocity by sin of direction (assuming direction=0 is when your box is on a flat surface. (this is so it slides down a slope)
If both are not touching, fall.

Then you can include wall sensors and all that other stuff separately.  I can write a script in a second if you want.

Last edited by Kileymeister (2011-07-13 22:55:57)


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

 

#3 2011-07-13 22:56:55

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: I need some physics ;_;

Kileymeister wrote:

I can write a script in a second if you want.

C:

that would be good c:


3

Offline

 

#4 2011-07-13 23:12:58

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

Re: I need some physics ;_;

Ok, here's the best I can do on short notice- I ripped apart my slope detector engine and rewrote some things, this should work:
http://i52.tinypic.com/30sj3aw.gif
Oh cripes, didn't realize it was that long until I put it here.  There's probably a MUCH simpler method.

Right-click > View Image I guess.

Last edited by Kileymeister (2011-07-13 23:31:46)


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-07-13 23:23:09

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: I need some physics ;_;

Kileymeister wrote:

Ok, here's the best I can do on short notice- I ripped apart my slope detector engine and rewrote some things, this should work:
http://i55.tinypic.com/4g4rgg.gif
Oh cripes, didn't realize it was that long until I put it here.  There's probably a MUCH simpler method.

Right-click > View Image I guess.

thanks, but even when i zoom in it's all blurry :I


3

Offline

 

#6 2011-07-14 14:52:26

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: I need some physics ;_;

bump


3

Offline

 

Board footer