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
3
G
3
Posts: 8
Reputation: 2,342

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
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

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
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

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
3
G
3
Posts: 8
Reputation: 2,342

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
61
S
19
G
6
Posts: 809
Reputation: 9,028

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
3
G
3
Posts: 8
Reputation: 2,342


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jul, nicklowkcmagic and 17 guests