[EDIT] Pinball Problems

0 favourites
  • 6 posts
From the Asset Store
A classic pinball game with an interesting twist!
  • 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?

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • There was an old Tutorial of making pinball game with physics, but unfortunately the files seem to be missing.

  • Cheers, having a look at it now!


    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.

  • 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:

    Assertion failure: Bounce normal computed as NaN

    Stack trace:















    Why doesn't it relaunch at the normal speed?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)