On ground check in physics?

For questions about using Classic.

Post » Sun Nov 30, 2008 3:05 pm

Hello everyone, I'm kind of new to COnstruct, so I need your help. I performed a search but couldn't find anything.

My question is:

Is there a way to check whether an object is on the ground, or is at rest, if the object's behavior is physics behavior? Thanks.
B
1
G
4
Posts: 9
Reputation: 1,043

Post » Sun Nov 30, 2008 6:06 pm

Add a small invisible sprite just beneath the player's feet - if that is overlapping the ground, the player must be on the ground.

To check if the physics behavior has come to rest, check that both the X and Y velocities are close to zero. Mind out that it might not exactly equal zero - it might just have a very small velocity. Have some kind of threshold at which you consider the object at rest, like abs(X Velocity) < 0.01 or something.
Scirra Founder
B
359
S
214
G
72
Posts: 22,948
Reputation: 178,532

Post » Sun Nov 30, 2008 10:25 pm

Thanks.

Two more questions, is it possible to restart the current layout? And how I do make other layouts just use the same sheet as one? I create an empty sheet and make it include the other, but when I run the layout, nothing moves.

Thanks again.
B
1
G
4
Posts: 9
Reputation: 1,043

Post » Tue Dec 02, 2008 12:43 am

Oh hey nayon :). Wow, all these TIGS people are migrating over here now 8)

It's a shame you didn't finish Tower of Shoth, that game was looking really sweet. It was one of my early favorites. Anyway, welcome to the forum
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Dec 02, 2008 7:41 pm

Thanks. Well I am going to work on it but Game Maker is frustrating me. That and I need a spriter.
B
1
G
4
Posts: 9
Reputation: 1,043

Post » Wed Dec 03, 2008 2:12 am

I would say to remake it in Construct, but in actuality that rotating tower is probably one of the few things that would be easier to do in GM :P.

Anyway, good luck with it, I hope it does get finished some day.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests