[EDIT] Pinball Problems

Get help using Construct 2

Post » Mon Jan 20, 2014 10:03 pm

Hello,

I was trying out some ideas by making a quick pinball game. I made the paddles rotate by placing the origin point where I wanted it, and the paddles rotate between angles correctly. So far, so good.

However, when I add physics to them so they can interact with the ball and set them as immobile (as I do not wish them to fall), they seem to rotate around a middle point, rather than the origin. I there a way to fix this?

Allbrotnar2014-01-21 22:04:56
B
5
G
1
Posts: 22
Reputation: 467

Post » Mon Jan 20, 2014 10:53 pm

You shouldn't ever use immoble for anykind of moving physics object. If you force an immoble object to move. It's likely the physics results won't occur very well. "immobile" is meant for static objects.

I would suggest instead adding a limited revolute joint to the paddles instead.

and finally. i don't see a lot of good things coming from using physics. I would suggest using bullet behaviour on the ball. then when a paddle hits the ball just adding extra force to the balls speedl
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Tue Jan 21, 2014 1:38 am

Great, thanks! I'll play around with those solutions and see what works.

This is the first time I played around with physics... It was trickier than I expected.
B
5
G
1
Posts: 22
Reputation: 467

Post » Tue Jan 21, 2014 1:52 pm

There was an old Tutorial of making pinball game with physics, but unfortunately the files seem to be missing.
Need help? Upload .capx file with your question.
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

Post » Tue Jan 21, 2014 9:25 pm

Cheers, having a look at it now!

*EDIT

Had a look and the missing CAPX is a real bummer. I think I'll be playing with it without physics on the ball and paddles.Allbrotnar2014-01-21 21:39:56
B
5
G
1
Posts: 22
Reputation: 467

Post » Tue Jan 21, 2014 10:11 pm

Have ditched physics almost entirely, at least for the paddle and ball.

My problem now is with the spring that launches the ball. I can't post links yet, so I'll do my best to explain the setup.

The spring moves down by pressing the Down key. Each pixel adds 1 to its Movement instance variable.

When the Down key is released, the spring reverts to its original position, the Bullet behavior is enabled on the Ball, which bounces off the spring. This launches the ball successfully.

I've implemented a reset key for when the ball accelerates too much and goes through the level barriers. This puts the ball in its original place on top of the spring, disables the Bullet behavior and sets its Bullet speed and acceleration to 0.

When I reset and relaunch the ball, it simply disappears off screen. If I reset it one more time and try to launch it again, I also get a big javascript error and the same thing happens.

This is the error:
[quote]
Assertion failure: Bounce normal computed as NaN

Stack trace:
[email protected]://localhost:50000/preview_prelude.js:12
[email protected]://localhost:50000/preview.js:3773
[email protected]://localhost:50000/Bullet_behavior.js:291
[email protected]://localhost:50000/eveng.js:1644
[email protected]://localhost:50000/eveng.js:850
[email protected]://localhost:50000/eveng.js:807
[email protected]://localhost:50000/preview.js:3998
[email protected]://localhost:50000/preview.js:3917
[email protected]://localhost:50000/preview.js:3850
[email protected]://localhost:50000/preview.js:3811
[email protected]://localhost:50000/Keyboard_plugin.js:130
instanceProto.onCreate/<@http://localhost:50000/Keyboard_plugin.js:60
[email protected]://localhost:50000/jquery-2.0.0.min.js:4
x.event.add/[email protected]://localhost:50000/jquery-2.0.0.min.js:4
[/quote]

Why doesn't it relaunch at the normal speed?Allbrotnar2014-01-21 22:13:36
B
5
G
1
Posts: 22
Reputation: 467


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests