How do I Make Physics and Wrap Works Together?

Get help using Construct 2

Post » Tue Dec 16, 2014 10:56 am

I'm creating asteroid games.
I want to use physics to make realistic collision between Asteroids and the ship.
But physics don't work well with wrap. After the wrap, the ship speed becomes 0

Then, I tried to simulate wrap. Fly off the screen to the left, and shows up from right by calculating its' velocity. But I can still see the moment, when the speed becomes 0, before it flies again. In other words it doesn't work smoothly.

Any ideas?
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Tue Dec 16, 2014 4:37 pm

I've found some ways
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Sun Feb 15, 2015 7:53 am

How did u do it? I'm trying to do the exact same thing.
B
5
S
1
Posts: 12
Reputation: 399

Post » Mon Feb 16, 2015 5:02 pm

Easy, turn off the physic when you're outside the layout. And turn it on when you're back.
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Thu Mar 19, 2015 3:08 am

This doesn't seem to work at all for me can u be more specific.
B
5
S
1
Posts: 12
Reputation: 399

Post » Thu Mar 19, 2015 3:59 am

OK i figured it out and it is smooth to. Do not give the players the wrap behavior. Give the player to instance variables to store the x and y velocity when they got out of layout. Disable physics when outside of layout. Reset the x and y depending on witch side of the layout the player left. (compare Players x/y with the layout width/height then reset both x and y velocity and Enable physics.

WA LA! Easy.... not really. Its a mouthful but its not to hard just hard to type out.
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 12
Reputation: 399


Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 27 guests