Bouncing circles.

Get help using Construct 2

Post » Fri Feb 03, 2012 7:43 pm

How to make bouncing circles, like in arkanoid, but in whole screen (walls on the top, down, righ and left. And how to make them bounce off each other? Tried with bullet behavior, but it doesnt do it right. Any ideas?
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Fri Feb 03, 2012 7:47 pm

If you use the bullet behaviors action, bounce of object it should work,

do something like this:

Object1.onCollisionWith(Object2)
     ->Object1.BounceOfObject(Object2)
     ->Object2.BounceOfObject(Object1)

Or just use the physics behavior
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Fri Feb 03, 2012 8:06 pm

I've decided to use physics, but how to prevent circle go crazy after a few collisions? :D

here's CAPX
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Fri Feb 03, 2012 8:17 pm

You could either set the friction of the floor to something like 15 or simply set the restitution of the ball to a lower value.
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Fri Feb 03, 2012 8:48 pm

changed, still same problem.. can someone post fixed cap?

CAPXMastaZavr2012-02-03 20:50:08
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Fri Feb 03, 2012 9:12 pm

OK, I changed the collision mask of the ball to circle - that helps the bounce to angle correctly. Then I changed the Elasticity to under 1.0 (you had 1.4) - This helps it bounce a little less each bounce. I also reduced the size of the image ball, and centered the origin point didn't fix anything, but it is a good practice... http://www.box.com/s/f7nhqiuc7xhlxzld6p9m
B
192
S
6
G
7
Posts: 213
Reputation: 10,178

Post » Fri Feb 03, 2012 9:13 pm

Adjust the elasticity of the ball to 0.95 or something like that to make it REAL bouncy, but still calm down after a few seconds.
B
192
S
6
G
7
Posts: 213
Reputation: 10,178

Post » Fri Feb 03, 2012 9:17 pm

The problem is that I want them to move without stoping and boucing off every wall.How to do that? :D
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Fri Feb 03, 2012 10:25 pm

Add an impulse to the ball each time it collides with a wall.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793


Return to How do I....?

Who is online

Users browsing this forum: Je Fawk, theosciandra and 27 guests