How to tell if physics object is in air?

Get help using Construct 2

Post » Mon Dec 05, 2011 9:06 pm

I have a 2D car, like those dirt bike games, how can i tell if its in the air? :) Thanks
B
30
S
13
G
7
Posts: 740
Reputation: 7,964

Post » Mon Dec 05, 2011 9:30 pm

When it is not overlapping the ground I think.

Object car -> is overlapping object Ground.
Right-click: Invert
New to Construct ? Where to start



Image Image

Image Image



Please attach a capx to any help request or bug report !
Moderator
B
262
S
93
G
55
Posts: 7,150
Reputation: 67,069

Post » Mon Dec 05, 2011 9:44 pm

Move the sprite 1 pixel down, check for overlap with ground then move the sprite back up.

every tick:
----Sprite| set isInAir to true
----Sprite| set Y: y+1
Sprite| is overlapping ground:
----Sprite| set isInAir to false
every tick:
----Sprite| set Y: y-1
B
85
S
27
G
77
Posts: 5,010
Reputation: 53,754

Post » Tue Dec 06, 2011 2:12 pm

Thanks guys got it working now :)
B
30
S
13
G
7
Posts: 740
Reputation: 7,964


Return to How do I....?

Who is online

Users browsing this forum: 20170217, alitest, halexand, MaeTrees, MSNbot Media, TheSynan, Underdog and 0 guests