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 Programming By Example

You're reading from   GameMaker Programming By Example Master the development of 2D games by learning to use the powerful GameMaker Language and tools provided by the GameMaker: Studio workspace and engine!

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785887963
Length 212 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Brian Christian Brian Christian
Author Profile Icon Brian Christian
Brian Christian
Steven Isaacs Steven Isaacs
Author Profile Icon Steven Isaacs
Steven Isaacs
Arrow right icon
View More author details
Toc

A physics game


In this section, we will program a small physics sandbox. We're not going very in-depth, as this is intended to be a small introduction to the physics engine, not a complete tutorial. Let's first explain some information that you'll need to know when you're using GameMaker's physics engine. For one, you should not mix physics-specific code with code that controls movement that doesn't use physics (for example, use physics speed variables rather than the variable speed). It's also important to limit how many physics instances are active at once in your game, as they use intense calculations to make everything flow properly. In relation to this, use parenting for collision checks—children will not inherit physics properties, but they can inherit collision events. If you had five different enemies, it's best to have your player check for a collision with a parent rather than all five of those different enemies, if you can.

But anyway, let's start with making our physics game....

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 ₹800/month. Cancel anytime