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

Creating the main ship


The first step in our game will be to create our main ship, controlled by the player. Make a new GameMaker project. We're going to make this game in a little retro style, so draw two subimages for your main ship's sprite, one for forward, and one for tilting right (which we will repurpose for tilting left with image_xscale). Typically in games of this style, no extra sprite will exist for moving downward, and it will use the same one as for moving forward. The subimages should be 32 x 32, to make some things easier later on. When creating your ship, give it two guns, one on each side. An example is shown as follows:

Once you have made your ship's subimages, modify the sprite's bounding box as usual, and also make sure to center the origin (on both axes) so that we don't run into any issues with image_xscale and so that we can easily program the vertical movement, accounting for going off of the screen. After this, create the object for your main ship and assign it 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