Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Construct 2 Game Development by Example
Construct 2 Game Development by Example
Construct 2 Game Development by Example
Ebook364 pages1 hour

Construct 2 Game Development by Example

Rating: 0 out of 5 stars

()

Read preview

About this ebook

This book uses practical examples to teach readers, and imparts the key skills and techniques of working in Construct 2 through building complete game projects.
This book is for complete beginners who have always wanted to learn how to make games and have never tried. It is the perfect introduction to game development, design, and production.
LanguageEnglish
Release dateJun 25, 2014
ISBN9781849698078
Construct 2 Game Development by Example

Read more from John Bura

Related to Construct 2 Game Development by Example

Related ebooks

Computers For You

View More

Related articles

Reviews for Construct 2 Game Development by Example

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Construct 2 Game Development by Example - John Bura

    Table of Contents

    Construct 2 Game Development by Example

    Credits

    About the Author

    About the Reviewers

    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

    Reader feedback

    Customer support

    Errata

    Piracy

    Questions

    1. Getting Started with Construct 2

    Downloading and installing Construct 2

    What do the numbers mean?

    Coding in Construct 2

    Working with visual programming languages

    Layout and event sheets

    Sprites

    Summary

    2. Inputs and Controls

    Getting started with inputs and controls

    Keyboard inputs

    Inserting a new keyboard object

    Adding functionality to the keyboard object

    Setting the keyboard key

    Controlling the sprite with the keyboard

    Setting up the direction of the sprite's movement

    Setting keys for other directions

    Testing the keyboard controls

    Making the sprite move constantly

    Changing the sprite's speed

    Keeping the sprite onscreen

    Mouse inputs

    Adding mouse functionality

    Setting up the Every tick command

    Rotating the sprite to the mouse location

    Facing the sprite towards the mouse point

    Touch control inputs

    Summary

    3. Variables and Arrays

    Introducing variables

    Number variables

    Integer variables

    Real variables

    String variables

    Boolean variables

    Other variables

    Declaring variables

    Writing variables in code

    Variables in JavaScript

    Examining JavaScript code

    Variables in Construct 2

    Adding a variable

    Creating a global variable

    Creating a score variable

    Adding a variable to a sprite

    Creating a health variable

    Introducing arrays

    Adding an array in Construct 2

    Checking an array's properties

    Setting data and adding variables

    Checking an array for data

    Summary

    4. Game Mechanics

    Introducing game mechanics

    Game mechanics in Construct 2

    Setting up a game mechanics project

    Adding a game mechanics behavior to a sprite

    Giving a sprite 8Direction movement

    Editing the properties of a behavior

    Creating a speed power-up

    Inserting the power-up object

    Adding a collision event

    Destroying the power-up on collision

    Increasing the player sprite's speed

    Setting the duration of the speed boost

    Restoring the player's speed to normal

    Summary

    5. Making a Simple Shooter

    Starting the project

    Controlling a sprite with the keyboard

    Organizing the event sheet

    Adding mouse controls

    Making the player shoot

    Adding the enemy

    Destroying the enemy

    Adding a spawner

    Summary

    6. Making a Tower Defense Game

    Starting the project

    Creating a spawn point

    Laying out the level

    Setting up the turrets

    Adding enemies and projectiles

    Rotating the turret

    Firing the turret

    Setting up the path for the enemy

    Setting up an enemy wave

    Summary

    7. Making a Puzzle Physics Game

    Starting the project

    Setting the background layer

    Adding the cannon

    Adding sprites

    Adding functionalities

    Rotating the cannon

    Creating a cannonball

    Spawning the cannonball

    Creating the spawning image point

    Adding physics

    Applying force at an angle

    Setting cannonballs to fire one at a time

    Setting the viewpoint to follow the cannonball

    Making an immovable ground

    Reloading the cannon

    Adding the blocks

    Destroying the cannonball on a complete stop

    Delaying cannonball destruction

    Designing our level

    Changing block density

    Adding the goal balls

    Destroying the goalBall sprite

    Adding particles

    Adjusting the particle settings

    Adding particles when goalBall is destroyed

    Tracking the score

    Adding text objects to the HUD

    Spawning the textbox

    Correcting the spawning angle

    Expanding the HUD

    Anchoring the HUD to the camera

    Setting up an HUD cannonball tracker

    Finalizing the game

    Losing the game

    Restarting the game on Game Over

    Winning the game

    Summary

    8. Exporting Your Game

    Exporting games in Construct 2

    Setting up a Dropbox account

    Exporting to an HTML5 website

    Choosing the template for your HTML5 export

    Assessing the contents of the game folder

    Uploading and sharing a game with Dropbox

    Other places to export your game

    Exporting to Chrome Web Store

    Exporting to Scirra Arcade

    Exporting to Kongregate

    Exporting to PhoneGap

    Exporting to Intel XDK

    Exporting to CocoonJS

    Exporting for Windows Phone 8

    Exporting to Tizen

    Exporting for the Amazon Appstore

    Exporting for Windows 8

    Exporting to Open Web App

    Exporting to Node-Webkit

    Summary

    A. Where to Go from Here

    Index

    Construct 2 Game Development by Example


    Construct 2 Game Development by Example

    Copyright © 2014 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: June 2014

    Production reference: 1180614

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham B3 2PB, UK.

    ISBN 978-1-84969-806-1

    www.packtpub.com

    Cover image by Asher Wishkerman (<wishkerman@hotmail.com>)

    Credits

    Author

    John Bura

    Reviewers

    Albert Chen

    D.M. Noyé

    Keefer Sery

    Commissioning Editor

    Pramila Balan

    Acquisition Editors

    Pramila Balan

    Sam Wood

    Content Development Editor

    Poonam Jain

    Technical Editors

    Pratik More

    Ritika Singh

    Rohit Kumar Singh

    Copy Editors

    Roshni Banerjee

    Adithi Shetty

    Project Coordinator

    Amey Sawant

    Proofreaders

    Paul Hindle

    Joanna McMahon

    Indexer

    Hemangini Bari

    Production Coordinator

    Shantanu Zagade

    Cover Work

    Shantanu Zagade

    About the Author

    John Bura has been programming games since 1997 and teaching since 2002. He is the owner of the game development studio Mammoth Interactive. This company produces games for Xbox 360, iPhone, iPad, Android, HTML5, ad-games, and others. Mammoth Interactive recently sold a game to Nickelodeon! He has been contracted by many companies to provide game design, audio, programming, level design, and project management. To this day, he has contributed to 40 commercial games. Several of the games he has produced have risen to number one in Apple's App Store. In his spare time, he likes playing ultimate frisbee, cycling, and working out.

    About the Reviewers

    Albert Chen is Assistant Professor in the Game Design and Development program at Cogswell Polytechnical College in Sunnyvale, CA. He has led students in developing serious games using game engines for The Boeing Company, NeuroSky, and Ericsson. His team won the Boeing Performance Excellence Award in 2008.

    Prior to joining Cogswell in 2007, he was a professional game developer for over 12 years, working at EA, LucasArts, Factor 5, and The 3DO Company. He has a Bachelor of Arts degree in International Relations from UC Davis and a Master of Arts degree in Entrepreneurship and Innovation from Cogswell Polytechnical College.

    I would like to thank my family for their love and support: Joy, Kayli, Brandon, and my mother, Sin-Hing Chen.

    D.M. Noyé (Dwandell M. Noyé) is a successful entrepreneur, conceptual designer, and technical consultant 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 Packt Publishing for believing in my expertise and giving me the opportunity to share it on this great project. I'd also like to thank the entire Scirra Construct community for the deep knowledge base they've built over a number of years, allowing me to acquire the forward-thinking skill of event-based programming.

    Keefer Sery is currently a Game Art and Production major at Drexel University, expecting to graduate in 2015. He is also a freelancer for Digitas Health. His most notable work in Construct 2 was a segment of the research and development for Evolutionary Guidance Media's Cyberhero League. The project went on to become a winning entry in the World Future Society's BetaLaunch competition.

    I would like to thank my grandmother, Janet Mitchener, for giving me the opportunity to attend school, and Dr. Dana Klisanen for giving me my first break in the industry.

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

    Copy and paste, print and bookmark content

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

    Preface

    Games have always been my passion. Creativity and production have always been on my mind. I love talking about production and I hope you enjoy reading about how to make games. This book will give beginners a first-hand knowledge of how to make games in Construct 2. I made my first game in 1997 when I was attending university.

    In this book, you will learn how to make several games and learn the secrets of game development. After reading this book, you should have several playable games to build a foundation and move forward. It is important that

    Enjoying the preview?
    Page 1 of 1