How do I make this... without physics

Get help using Construct 2

Post » Wed Jun 24, 2015 6:13 pm

I wonder if is possible to create this kind of movement (displacement?) without physics behavior. If is possible, without oscillations too (that occurs when the sprites falls and collide with others).

Thanks in advance.

https://www.dropbox.com/s/e1lwu0ai69hoz ... .capx?dl=0
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

Post » Wed Jun 24, 2015 9:43 pm

Yes you can, it becomes much simpler to do physics when it's just in a line like that.
The motion is simple: increase the speed with gravity and move down with the speed.
Collision detection is done by looping over the blocks from the bottom up. If the current block overlaps the block below push it up and set it's speed to the speed of the block below ...and repeat.

https://dl.dropboxusercontent.com/u/542 ... olumn.capx

ps. the speed change isn't physically correct when the objects collide. The actual speed of both blocks after a collision should be the average of the speeds, but it would add some complexity to the events.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Thu Jun 25, 2015 10:26 am

Hi @R0J0hound

I had some performance issues with the physics behavior and I am afraid to use it after that. I'll try your suggestion, do some tests and compare the results. Thank you very much for taking your time (precious, for sure) to assist me in this matter.
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

Post » Thu Jun 25, 2015 10:05 pm

If I enjoyed doing it (which I did), then it was time well spent.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849


Return to How do I....?

Who is online

Users browsing this forum: Akia410 and 10 guests