Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Construct 2

You're reading from   Learning Construct 2 Design and create your own engaging, extensible, and addictive game using Construct 2

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781784397678
Length 234 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Aryadi Subagio Aryadi Subagio
Author Profile Icon Aryadi Subagio
Aryadi Subagio
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Joining two objects


I have given you examples of how to use forces and impulses to move physics objects around, but I haven't covered joints yet. Joints are used to join two objects together so that the distance between them is the same. We will make a bridge using joints, so, create a new layout and make it look like the one shown in the following screenshot:

The sprites for the bridge and the fence objects are located under the Tiles folder. Before continuing, check the bridge's collision polygon and fix it so that no lines will intersect each other, just like the buttonBlue object. You want to be careful when adding physics objects, as small sprites tend to have similar collision polygons.

Tip

Always look for collision polygons when adding an object you want to make a physics object, especially the ones with small sprites.

The fences and bridges are physics objects, but only the fences are immovable; the bridges are still movable, but we won't let them fall to the bottom. We will tie the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image