Pinball - Physics to the max!

5

Index

Stats

9,329 visits, 22,648 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 28 Dec, 2011. Last updated 19 Feb, 2019

Since my Pinball example seems to be from quite some interesst, I will try to compile this tutorial for everyone trying to use the physic behavior for similar games.

This Tutorial was compiled for an earlier version of Construct. If you want to take a closer look at it, you need to install the deprecated plug-in -> PLUGIN

The complete CAPX

holds all the artwork needed.

The most important parts of a Pinball

The Ball

This is easy. Take a Sprite, call it Ball and add the physics-b

ehavior.

The collision mask is here set to circle

The Boundry

The Ball has to stay inside the Layout and also bounce of the walls that you'll place on the scene. Therefor you need different instances of the same sprite.

I've used a simple square-sprite (dark blue) with physics-behavior and the following properties:

Collision Mask: use collision polygon

Please note, that the boundry is set to "immovable"

The Flipper-Paddel

This is now the first active element. So it get's a little more complicated. Again, first of all you need a sprite. Set the collision mask to: use collision polygon

Make sure, that the sprite has the physics-behavior added.

Since the paddle has to be moveable and to transport impulse, we need to imagepoints - one as pivotpoint, the other to apply force and impulse to.

Place the paddle whereever you like, but make sure that it is "moveable"

Now, if you would place all three items on a layout and would run it, the ball and the flipper would fall to the "ground", just the boundry stays in place.

We want the paddle to stick to one position, so we need to "fix" it. This is done by calling Create limited revolution joint an join the pivotpoint to the boundry. Do this within an On Start of Layout event

If you run the project now, the paddles should stay in place.

  • 0 Comments

Want to leave a comment? Login or Register an account!