Breakout: Fluid Physics on Ball Launch?

Get help using Construct 2

Post » Mon Jul 08, 2013 10:55 pm

Heya!
I can't seem to get a stable thrust with the 'Physics Behavior' when I launch the ball. The ball's force is too strong.

Capx

I tried the game with the 'Bullet' Behavior but it was just too slow and less bouncy, not as fluid as using the 'Physics' behavior. Slower Breakout Game Demo

I did manage to launch the ball by using the Touch behavior but the ball launches too fast.

To set the force at a reduced speed I tried:
System: Every Tick > Ball > Apply Physics: Force 1, at angle 270 (up direction)


...But no luck. Any ideas?

Thanks!
-AleX
NECROKRIEG2013-07-08 23:09:11
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Mon Jul 08, 2013 11:12 pm

You can play around with X,Y velocity ...

Or you could do this ...

Set Gravity to 0

And apply 1x (one) Impulse

It should always keep the object at the same speed because there's no gravity

Cheers !Whiteclaws2013-07-08 23:17:08
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Wed Jul 10, 2013 2:59 pm

Thanks @Whiteclaws!

So I have set the World's Gravity to Zero. That has made the Ball stand still which is good.

Iv added 'Impulse Towards Position' to the Ball so it will increase the speed every time it ricochets off an object. (My understanding of Impluse)

DEMO



https://dl.dropboxusercontent.com/u/20299415/capx-forum/Pictures/Physics-Pics/Ball-Impulse-Towards-Angle.png

BUT
The ball seems to decrease in speed overtime, even though the ball is rebounding off objects which should increase the speed.

What do you think the problem is?
I think it might be to do with the Touch controls as the force is based on the click or touch of the player.

Capx

Cheers!
-AleXNECROKRIEG2013-07-10 15:05:31
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Wed Jul 10, 2013 8:19 pm

It's the elasticity , try and set the object that collide with the player and the player's elasticity to a high value

Edit : Yep , Fixed it , Also , In the ball's physic behavior's settings

Set Prevent Rotation to Yes

Cheers !Whiteclaws2013-07-10 20:23:54
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Wed Jul 10, 2013 9:41 pm

Thanks Whiteclaws!

I hit the elasticity up from 0.8 to 1.
I then increased the Ball's Impulse to 1100.

Seems to do the trick! I think I was over thinking, simplicity is the key!

Now I'm going to add a one-click only Ball launch. Maybe an Instance, Boolean variable will do the trick!
B
15
S
6
G
3
Posts: 87
Reputation: 4,304


Return to How do I....?

Who is online

Users browsing this forum: ashishv, IceManLT, morti and 4 guests