Construct Game Development Beginners Guide - Daven Bigelow - E-Book

Construct Game Development Beginners Guide E-Book

Daven Bigelow

0,0
34,79 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Construct Classic is a free, DirectX 9 game creator for Windows, designed for 2D games. Construct Classic uses an event-based system for defining how the game behaves, in a visual, human-readable way - you don't need to program or script anything at all. It's intuitive for beginners, but powerful enough for advanced users to work without hindrance. You never know when you'll need a helping hand exploring its inner workings, or harnessing its raw power to do your bidding.Construct Game Development Beginner's Guide is the book for you if you have ever felt the urge to make a game of your own. Reading this book will not only teach you to make some popular games using Construct, but you'll also learn the skills necessary to continue on and bring your game ideas to life.Starting as a beginner to Construct Classic, you'll be learning to make platform, puzzle, and shooter games, each styled after popular games of their genre.

This guide covers everything from creating animated sprites, to using the built-in physics and shadow engines of Construct Classic. You will learn the skills necessary to make advanced games of your own.

Construct Game Development Beginner's Guide will lead you on your journey of making games.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 229

Veröffentlichungsjahr: 2012

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Construct Game Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action — heading
What just happened?
Pop quiz — heading
Have a go hero — heading
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Our First Look at Construct
The first step: downloading and installing Construct Classic
Time for action — getting Construct Classic up and running
Step two: creating a game project
Time for action — starting a game project
What just happened?
Creating the project
Changing the project details
Running the project
Have a go hero — try again from memory
Step three: navigating the interface of Construct Classic
Time for action — clicking our way around Construct Classic
What just happened?
The layout editor
The properties box
The event editor
The animator box
The layers box
The final step: an introduction to objects
Time for action — creating some objects
What just happened?
Creating an object
Drawing the sprite
Changing the appearance of the sprite
Have a go hero — make a picture of sprites
Summary
2. Hello World! Construct Style
Sprites revisited
Time for action — creating a player sprite
What just happened?
Creating new animations
Animation tags
Choosing the Collisions mode
Tiled backgrounds: defining the world
Time for action — make some tiled backgrounds
What just happened?
Have a go hero — another tiled background
Attributes: telling Construct more about our objects
Time for action — adding attributes to our objects
What just happened?
Behaviors: teaching objects how to act
Time for action — getting our player moving
What just happened?
The behaviors
Setting controls
Variables: private and global
Time for action — giving our player a life
What just happened?
Textboxes: giving the player a heads-up
Time for action — showing our player their health and score
What just happened?
Events: setting the rules and goals of a game
Time for action — very eventful games
What just happened?
The sprites
Events
Conditions
Actions
Summary
3. Adding the Challenge
Before we start
Reaching the goal
Time for action — making the game winnable
What just happened?
Overlapping versus collision
Set activated
Set animation
Avoid the hazards
Time for action — bestowing more challenges on a player
What just happened?
The death of a player
Resurrecting our player
Giving the player a game over
Putting some bad guys in
Time for action — adding an enemy and making him move
What just happened?
Direction of motion
Falling down
Turning around
Looking for a hit
Have a go hero — gaining lives
Improving our interface
Time for action — creating a background for the GUI
What just happened?
Have a go hero — design a custom panel image
Pop quiz — recap
Summary
4. Making Noise
A game and its music
Time for action — add some music to our game
What just happened?
The start of layout condition
Playing the music file
Looping the music file
Modules of music
Time for action — play some mod music
What just happened?
The Is playing condition
Loading and playing the file
Sounds: describing the action
Time for action — adding sounds
What just happened?
Exporting our game
Time for action — exporting our game
What just happened?
Have a go hero — make another platformer
Pop quiz — sound and music
A note on sharing our games
Summary
5. Practical Physics
Creating physical objects
Time for action — creating our objects
What just happened?
The Global property
Aligning to a grid
Setting the Physics properties
The Timer behavior
Creating a custom physics collision mask
Event sheets and groups
Time for action — creating and using Event sheets and groups
What just happened?
Adding a physical force
Time for action — creating forces
What just happened?
Adding special pegs
Time for action — creating specialty pegs
What just happened?
The For loop
Set timescale
Portals: a way of getting from A to B
Time for action — teleporting the ball
What just happened?
Particle objects: creating a fireworks finale
Time for action — creating fireworks
What just happened?
Playing the sounds and music
Time for action — adding the sounds and music
What just happened?
Creating another level
Time for action — making another level
What just happened?
Have a go hero — create additional levels
Meet the debugger
Time for action — looking through the debugger
What just happened?
Pop quiz — physical games
Summary
6. Custom Levels
The user friendly INI file
Time for action — creating an INI file
What just happened?
INI groups
INI items
Loading levels
Time for action — load custom levels
What just happened?
Setting the INI file
Loading the level
Including the Game event sheet
The NextINI layout
The Game Over screen
Time for action — creating the Game Over layout
What just happened?
Making a level editor
Time for action — creating the objects
Time for action — loading and saving levels with events
Time for action — creating events for the interface
What just happened?
The edit region
The function object
Enabling and disabling groups
Writing to an INI file
Positioning the Cursor object to a grid
Placing portals
Have a go hero — make a level editor for your platform game
Pop quiz — INI file recap
Summary
7. Platformer Revisited, a 2D Shooter
Before we start
Multiplayer: getting your friends involved
Time for action — creating the game assets and title screen
Time for action — designing the level
Time for action — creating player characters and conveyor belt objects
Time for action — creating the HUD objects
Time for action — creating the main game events
Time for action — creating the Game Over layout
What just happened?
Families
Containers
Multiplayer
Static scrolling
Shooting bullets
Time for action — adding some guns
What just happened?
Parallax: giving the impression of depth
Time for action — creating parallax scrolling
What just happened?
Have a go hero — add more scenery
Lights and shadows: illuminating the darkness
Time for action — using lights and shadow casters
What just happened?
Enemies with guns: slightly more challenging
Time for action — making some enemies
What just happened?
Manual collision detection
Basic AI
Spawning a gun
Pop quiz — a shot in the dark
Summary
8. I'm Throwing a Grenade!
Grenades — bouncing, timed explosives
Time for action — throwing grenades
What just happened?
Throwing the grenade
Bouncing the grenades
Explosions — big bright lights
Time for action — explosion flashes
What just happened?
Effects — distortions and other nice things
Time for action — adding some distortion
What just happened?
Pixel shaders
The effects used
Have a go hero — more visual effects
Objects — completely blown away
Time for action — blast the robots away
What just happened?
Have a go hero — extend the game
Pop quiz — looking back on timers and effects
Summary
9. Our Final Moments
What we've learned
Chapter 1, the basics of the Construct Classic editor
Chapter 2, our first game, MyPlatformer
Chapter 3, adding enemies and a lives system
Chapter 4, playing sounds and music
Chapter 5, a physics game
Chapter 6, custom levels and level editors
Chapter 7, A sidescrolling shooter
Chapter 8, effects and physics interactions
Extending our games
MyPlatformer
BounceBall
SideShooter
Tips and tricks
Custom collision masks
Adding custom plugins
Adding custom effects
Using the Canvas object
Using the Minimap object
Using the Plasma object
Make backups often; make saves even more
Finding help
A note on Construct 2
Summary
A. Pop quiz Answers
Chapter 3: Adding the Challenge
Recap
Chapter 4: Making Noise
Sound and music
Chapter 5: Practical Physics
Physical games
Chapter 6: Custom Levels
INI file recap
Chapter 7: Platformer Revisited, a 2D Shooter
A shot in the dark
Chapter 8: I'm Throwing a Grenade!
Looking back on timers and effects
Index

Construct Game Development

Construct Game Development

Copyright © 2012 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: May 2012

Production Reference: 1110512

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

ISBN 978-1-84951-660-0

www.packtpub.com

Cover Image by Vinayak Chittar (<[email protected]>)

Credits

Author

Daven Bigelow

Reviewer

D.M. Noyé

Acquisition Editor

Usha Iyer

Lead Technical Editor

Shreerang Deshpande

Technical Editors

Unnati Shah

Mehreen Shaikh

Project Coordinator

Alka Nayak

Proofreader

Jonathan Todd

Indexer

Rekha Nair

Graphics

Manu Joseph

Production Coordinators

Prachali Bhiwandkar

Nilesh R. Mohite

Cover Work

Nilesh R. Mohite

About the Author

Daven Bigelow is a hobby game developer and a software programmer. He has been creating 2D games for over eight years, across different game creation tools and programming languages. However, most of his experience lies in Construct Classic, which has been his tool of choice over the last three years.

He can often be found on the Scirra forums under the name Jayjay, where he provides advice and examples for new users seeking help.

I would like to thank all my friends and family who encouraged me along the way. I also send thanks to the publisher, Packt Publishing, and all of its employees for their efforts.

Lastly, I thank you, the reader, for reading this book. I hope that it meets all of your expectations.

About the Reviewer

D.M. Noyé is a successful entrepreneur with extensive experience working on major commercial projects with a number of large corporations, as well as independent ventures spanning several fields, from music and literary arts to video games.

I'd like to thank the entire Scirra Construct community and development team for all of their years of hard work and dedication and for always being willing to share their insights and talents, making it possible for me to gain knowledge of how to use this great development tool and pass on that knowledge to others.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com, and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

I dedicate this book to my cousin Ken, who first inspired me to make video games.

Preface

Welcome to Construct Game Development Beginner's Guide. In this book, you will be learning to use the free and open source software Construct Classic to make your own video games from scratch.

Construct Classic is a DirectX 9-based game creation environment for Windows, designed for making 2D games. Construct Classic uses a graphical event-based system for defining how the game behaves, in a visual, human-readable way — you do not need to program or script anything at all. It's intuitive for beginners, but powerful enough for advanced users to work without hindrance.

So, if you have ever wanted to make video games, and haven't tried before, this book will help you get started!

What this book covers

Chapter 1, Our First Look at Construct, covers the basics of the Construct Classic editor.

Chapter 2, Hello World! Construct Style, covers the making our first game, a classic platformer.

Chapter 3, Adding the Challenge, covers creating enemies and a goal for our platform game.

Chapter 4, Making Noise, covers playing music and sound files in Construct Classic.

Chapter 5, Practical Physics, covers making our second game with the built-in physics engine.

Chapter 6, Custom Levels, covers making a level editor to save and load external level files.

Chapter 7, Platformer Revisited, a 2D Shooter, covers learning to make a platform shooter.

Chapter 8, I'm Throwing a Grenade, involves learning to use pixel shader effects in our games.

Chapter 9, Our Final Moments, covers a summary of what we've learned and some extra tips.

What you need for this book

With screenshots and step-by-step instructions, this beginner's guide requires only an interest in making video games, and basic experience with the Windows operating system.

Who this book is for

If you have ever thought of making a 2D computer game of your own, this book is for you.

Conventions

In this book, you will find several headings appearing frequently.

To give clear instructions of how to complete a procedure or task, we use:

Time for action — heading

Action 1Action 2Action 3

Instructions often need some extra explanation so that they make sense, so they are followed with:

What just happened?

This heading explains the working of tasks or instructions that you have just completed.

You will also find some other learning aids in the book, including:

Pop quiz — heading

These are short multiple choice questions intended to help you test your own understanding.

Have a go hero — heading

These set practical challenges and give you ideas for experimenting with what you have learned.

You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "In our game, the player will have a Score private variable to store how many enemies they stomped in that life, while a Lives global variable stores how many lives they have left before they lose."

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes, for example, appear in the text like this: "Click on the Application 1 node in the Project window."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in the text or the code — we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Our First Look at Construct

In this book, we will be learning to use Construct Classic, a free open source 2D game creator. However, before we start making games, we'll need to know how to use the tool itself.

In this chapter, we shall:

Download and install the latest version of Construct ClassicCreate a new game projectLearn to navigate around the interface of Construct ClassicLearn to work with objects

So let's get on with it.

The first step: downloading and installing Construct Classic

Before we start using Construct, we need to get it running. In this part of the chapter, we'll be visiting the Scirra website to download a copy of Construct Classic, and then we'll go through the steps for installing it. If you already have Construct Classic installed, you can skip this step.

Time for action — getting Construct Classic up and running

Following these steps will lead to an installation of Construct Classic ready to go. To do this, you'll need access to the Internet and the Microsoft Windows operating system on the computer you're installing Construct on.

First, navigate your web browser to www.scirra.com. This is the home page of Construct Classic and Construct 2.Click on the Make Games tab, and choose the subtab Construct Classic.Next, scroll down and click on Download Construct Classic R1.2. This may change to newer versions of Construct Classic in future, but the link position will be the same. Click on the link to start your download.After downloading the installer, double-click to start the installation process.Click through the installer pages until finally presented with the option to begin installation.After the installation, the Visual Studio runtime will be installed along with the latest version of DirectX (downloaded automatically).The installation should now be complete, and Construct Classic is ready to load!

Step two: creating a game project

Now that Construct is installed, we will learn how to make a game (Direct-X) project after we first launch it.

Creating a project is the first step in making any game in Construct, but for now, we will create one to set us up for learning to navigate the interface.

Time for action — starting a game project

We are going to make a blank game project to allow us to navigate all areas of Construct.

Open up Construct and click File | New | New Direct-X game. This menu option is shown in the following screenshot:We now have a project. Click on the Application 1 node in the Project window. The display should now look similar to the following screenshot:For this chapter, we're just going to change the Creator and the Name boxes. Go ahead and type your name into the Creator box and My Game into the Name box.Now, we're going to test if the project works. Click on the Project ribbon button (shown in the following screenshot), and then click on the Run All button underneath it to start your game:We now have the pop-up window, which looks similar to the following screenshot. It doesn't look like much, but this is the starting point we will use to find our way around the interface of Construct Classic. Click the x button to close the window.

What just happened?

We've just learned how to create a blank game project file in Construct, give it a name, and run our entire game. These steps will be used again each time we start a blank game project.

Creating the project

While we were creating the project from the menu, you may have noticed the other two types of projects. We won't be requiring them to make our games, but it is worth knowing a little about them.

The first option is New Application, which creates a program that does not rely on Direct-X, and rather uses the built-in rendering used by Windows. This project type greatly restricts the plugins that can be used, and is not intended for creating games. As such, we will not use this application project type in this book.

The third option, New Template/Example, is a collection of starter projects and tutorials that can make creating games of certain genres easier. The most playable template included is the Ghost Shooter tutorial, which includes a fully-working top-down shooter to start with. In our case, however, we will be creating all of our games from scratch, so we can make all kinds of games from the ground up.

Changing the project details

Although our interaction in this step was basic, we caught a glance of all the options available for defining the project. For now, all we needed to know was how to change the name and the creator of the game, but later on, we'll be revisiting many of the properties shown in that list.

Running the project

In this final step, we learned how to start our game up. This step is fairly straightforward, but it is worth noting that another way to click on Run All is to click the small monitor icon next to the save icon.

Have a go hero — try again from memory

Now that we've learned how to create blank projects, try it again to see if you can remember how to do it.

Step three: navigating the interface of Construct Classic

Now that we have Construct Classic and a game project set up, we can explore all the areas of the Construct editor that we need to learn, to make games. For now, we are going to have a glance around the editor.

Time for action — clicking our way around Construct Classic

Using the game project from the previous exercise, we are now going to click through and look at various windows we'll be revisiting many times throughout the book.

Start a new blank game project as we learned earlier. We start the project in the Layout editor tab. By clicking the pin button on the Properties and Project boxes, they will minimize to the sides of the screen to provide more viewing area. It is also possible to resize these panels by holding the cursor over the edges of the boxes and clicking to drag their width. The following screenshot shows these buttons with arrows:Now click on the Event Sheet Editor tab to reach the view shown in the following screenshot. Notice that the ribbon bar automatically switches to the Events tab to provide some quick options.Now that we've visited both the event editor and layout editor, we can look at the boxes on the right side of the editor. We've already met the Properties box on the left-hand side, so now if the right box is minimized as shown in the previous screenshot, click on the pin button again to display it. You should see the following screenshot:Clicking on the Animator tab will show the animation box. It will be blank, as shown in the following screenshot, as we do not have an animated object to select yet:Finally, we can take a look at the Layers tab to see the different layers of our layout. Once again, there isn't much to see as we only have a blank game project right now, as in the following screenshot:

What just happened?

We've now learned to switch between the different views of the editor. Now, we can look more closely at what options are available for them.

The layout editor

This is the area that is used to create and modify the objects that make our games. Most changes made here are directly visible when the game is run.

The properties box

This box is used to modify the settings and values for most selectable items in Construct Classic. We will be using it frequently to make games throughout the book.

The event editor

In this area, we can create the rules for our games through conditions that trigger actions. An example of a condition is when a player touches a harmful substance (such as lava), we can make an event that checks for this condition and then triggers an action that removes a life from the player's lives variable.

The animator box

This box is used to create graphics and animations for our game objects the player will be interacting with.

The layers box

The layers box allows the organization of objects into different layers. This is useful for creating objects that scroll at different speeds to create a parallax effect, as well as a separate foreground and background objects. Layers can be hidden by clicking the eye icon, and locked by clicking the lock icon, as shown in the following screenshot. They can also be named in the Properties box.

The eye and the lock icon are found by default (visible and unlocked) on the left of each layer.

The final step: an introduction to objects

To finish the chapter, we are going to look at what objects are and what some of them do. Objects are the most important part of making a game in Construct as they usually interact directly with the player.