Physics: object stoped

Get help using Construct 2

Post » Sun Dec 04, 2011 5:05 pm

There is any easy way do detect if an object with physics behavior had stoped?

thanks.
B
10
S
4
G
3
Posts: 8
Reputation: 2,492

Post » Sun Dec 04, 2011 5:10 pm

i think that you need to add platform behavior and in the behavior property you make it custom keyboard and then in the event sheet

[invert]sprite is moving


and here ya go
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Sun Dec 04, 2011 7:20 pm

You can add the horizontal and vertical speed speed of the object, and compare that.Arima2011-12-04 19:20:42
Moderator
B
92
S
32
G
33
Posts: 3,005
Reputation: 27,582

Post » Sun Dec 04, 2011 8:19 pm

Thanks for the reply but if I put platform behavior, the physics goes crazy...

And if I just check the horizontal and vertical speed, there are some times that a ball goes up, STOP, and then goes down again, so it can't be trusted...
B
10
S
4
G
3
Posts: 8
Reputation: 2,492

Post » Sun Dec 04, 2011 8:31 pm

its something i just come up with, so i need to test it, but what if you compare the distance to a temp point, every so many ticks, this can tell you if its has been moved and check if its moving fast or not, and it doesn't need alot of overhead calculation, like velocity calculation
sqrt(Object.Physics.VelocityX ^ 2 + Object.Physics.VelocityY ^ 2)
ImageImage
B
68
S
20
G
7
Posts: 821
Reputation: 9,880

Post » Sun Dec 04, 2011 9:06 pm

Yes, there are some ways do to that, but I guessed that someone had come with a simple idea :)

Hope in future updates scirra could plan on something!
In the meantime, congratulations for this excelent software!
B
10
S
4
G
3
Posts: 8
Reputation: 2,492


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, Darknessed, Tarkin and 15 guests