Objects with perpetual movement

Get help using Construct 2

Post » Mon Jan 21, 2013 11:08 pm

Hello again!

Thanks again to everyone with the help on setting up the wall bouncing effect for my game. I've since added in a planet object and got it moving around the screen as well, but the problem is that as it bounces off the walls, it starts to gradually slow down. I'd like the planet objects (there will be more eventually) to move continuously at the same rate of speed.

I've tried setting the friction to 0 and played around with other settings in the physics behavior and I can't seem to figure it out. I also tried adding the bullet behavior to the object but that just made it somehow pass through the solid walls at the edge of the screen, so that approach didn't seem to work either. Help is greatly appreciated. I can post a link to a capx if it's needed.
B
8
S
1
Posts: 34
Reputation: 938

Post » Mon Jan 21, 2013 11:33 pm

posting a capx or a simplified capx to show the problem will always help
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Tue Jan 22, 2013 12:15 am

Sure thing! And to add, I've tried modifying all of the physics behavior setting on both the planet and sidewall objects, and it continues to slow down and eventually stop.

https://dl.dropbox.com/u/8938070/PegJam/gametest.capx

(I can't post actual links yet, unfortunately.)
B
8
S
1
Posts: 34
Reputation: 938

Post » Tue Jan 22, 2013 5:17 pm

Any ideas so far? :)
B
8
S
1
Posts: 34
Reputation: 938

Post » Tue Jan 22, 2013 8:04 pm

Try setting the elasticity to 1.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Tue Jan 22, 2013 11:48 pm

Fantastic! Thank you ramones! That works perfectly!
B
8
S
1
Posts: 34
Reputation: 938

Post » Wed Jan 23, 2013 4:01 am

Hmm, after some further testing this doesn't quite work. It does cause the planet to bounce around for much longer so it's good for the time being, but ultimately I'd like to be able to figure out how to have the planet move at a constant speed like the asteroids in "Asteroids", and other games like that. The game takes place in space so there the objects should never slow down, so there seems to be something I'm missing about how physics objects work in C2.
B
8
S
1
Posts: 34
Reputation: 938

Post » Wed Jan 23, 2013 1:29 pm

What do you want to happen if the ship hits the planet? I can push it around until it stops. If you don't want it to ever stop, or be moved by the ship, I'd give the bullet movement a go combined with the physics. This will allow the planet to move the ship, but may result in some unusual 'crushing' behaviour.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 929
Reputation: 9,356

Post » Fri Jan 25, 2013 7:47 pm

Eventually the ship will be destroyed if it comes into contact with the planet, like in Asteroids. I tried adding the bullet movement, but it causes the planet to pass right through the walls around the endges of the screen rather than bounce off of them.
B
8
S
1
Posts: 34
Reputation: 938

Post » Fri Jan 25, 2013 10:06 pm

Did you give the walls solid behavior and set the planet to bounce off solids?
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests