Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Gamemaker Essentials

You're reading from   Gamemaker Essentials Learn all the essential skills of GameMaker: Studio and start making your own impressive games with ease

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781784396121
Length 154 pages
Edition 1st Edition
Arrow right icon
Toc

Parents


In many other programming languages, it is possible to have objects created with the same attributes as another. In GameMaker, this is called parenting. A parent in GameMaker is any object that has had another object parented to it. Once an object has been parented, it can use the same code as its parent without it needing to be re-written. An object that has a parent is often referred to as a child object. Any events within the parent object are the ones inherited by the child, causing it to behave the same way. If an event is added directly to a child object, then the parent's event is discarded. It is, however, possible to still inherit the event using the GameMaker Language code.

Making a parent

To make an object a parent in GameMaker, you actually need to open up the object that is going to be the child of that parent. In the object's properties on the left side, there is a button that says Parent on it.

By clicking on the blue options button to the right, a drop-down list will...

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 AU $24.99/month. Cancel anytime