Book Image

Learning Stencyl 3.x Game Development: Beginner's Guide

By : INNES BORKWOOD
Book Image

Learning Stencyl 3.x Game Development: Beginner's Guide

By: INNES BORKWOOD

Overview of this book

Creating video games has traditionally been a long and complicated process, requiring years of experience and a vast array of skills. However, with the introduction of comprehensive game-development toolkits such as Stencyl, the fun has returned to the art of game-creation ‚Äì anyone who has the desire to create their own video game can now do so with almost any desktop computer and a free software download from the Internet!Learning Stencyl 3.x Game Development: Beginner's Guide will put you on the fast-track to learning the essentials of the powerful Stencyl game-development toolkit. You will develop a complete, ready-to-publish video game including in-game advertising, by following the clear, step-by-step tutorials, supported by numerous screenshots and practical examples.This book will guide you through all the important steps required to develop and publish your video game. Starting with the installation and testing of the Stencyl toolkit, you will very quickly advance to the fun and exciting process of creating a playable game. The step-by-step tutorials will guide you from a blank screen, right through to giving your game that final polish and sharing it with the rest of the world. Whilst developing your feature-complete video game, you will learn how to easily detect collisions in your game using Stencyl's built-in physics engine. You'll discover how to use the powerful animation tools included in Stencyl's toolkit, and you'll find out how to make your game shine with sounds and visual special effects. You will also discover how Stencyl makes it easy to utilize the touch-screen and accelerometer features of smartphones and tablet computers. You will learn all the essential skills required to develop a video game from scratch ‚Äì right through to publishing a game on the Internet and testing games  on the most popular mobile devices.
Table of Contents (20 chapters)
Learning Stencyl 3.x Game Development Beginner's Guide
Credits
Foreword
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

What makes Stencyl different


There are many game development tools available, but Stencyl has some stand-out features that make it very different from its competitors.

Stencyl runs on almost any desktop computer

Stencyl can be installed on nearly all popular desktop computers, and Stencyl files can be freely exported and imported between the different desktop platforms, which is very useful when working with friends or colleagues who use different platforms for game development.

Stencyl creates native code

Whichever platform we want to publish our game onto, Stencyl does all the hard work for us! It creates the game code specifically for that device, and it will not have to run the game in a wrapper that can slow our games down.

Although that might sound fairly technical, it just means that our games will run at the fastest possible speeds without us having to learn a new programming language for each target platform. Stencyl takes care of all the hard work when it comes to publishing to different target devices; we can just concentrate on creating our games!

You don't need to be a coder

Probably the greatest differentiator between Stencyl and other game development tools is the way in which the gameplay instructions are built. With many game development tools, you must hand-code the instructions in a specific programming language, which can be very tedious and time-consuming. Or, with some other development tools, you are required to point and click on the instructions that you want to select in order to build rules that the objects in your game will follow, which can be very restricting when it comes to complex gameplay.

The developers of Stencyl have created a system that offers an impressive set of options when compared to other currently available game development methods. There are four different options available to game developers when using Stencyl, so we can do the following:

  • Use Stencyl's built-in gameplay routines (called behaviors in Stencyl)

  • Download existing behaviors from StencylForge

  • Create our own behaviors using an intuitive drag-and-drop system

  • Hand-code our own gameplay instructions using a traditional programming language called Haxe

The magic of Stencyl is that we can mix and match any combination of the above development methods!

For example, if we want to create a basic game with common gameplay features, it's very easy to use Stencyl's built-in behaviors, and it's quite possible to develop a complete game in this manner.

At the time of publication, there were more than fifty built-in behaviors, a small sample of which is shown in the following screenshot:

Once we understand how the prebuilt behaviors work, we can either customize existing ones or we can create our own from scratch using the drag-and-drop behavior editor.

The following screenshot shows an example of a custom-built behavior, and even if you have never seen Stencyl before, you might be able to understand some of the instructions.

Finally, more advanced developers may choose to hand-code their own special game routines using the Haxe programming language (pronounced Hex, according to the main developer). This is certainly not a requirement for creating games, and many Stencyl users have never even tried this kind of development! Most Stencyl developers use a combination of prebuilt behaviors, customized behaviors, and also behaviors that they have created themselves, and these are the methods that we are going to be using throughout this book.

When our game is finished, we just need to decide which platforms we want to target, and Stencyl will do the rest with a few clicks of the mouse!

Using the free version of Stencyl

The free version of Stencyl has very few limitations compared to the subscription versions and in practice, you can use all the important game development features and make any kind of game with the free version that you can make with the subscription versions.

The main limitations of the free version of Stencyl are:

  • Only Flash and HTML5 games can be published

  • A Stencyl splash screen is displayed for a few moments when a published game loads

  • Custom preloaders can't be implemented (these are the loading screen and progress bar that you see when your game first loads)

  • Some monetization features are limited

The great thing about the free version of Stencyl is that we can develop our games to completion, publish them for Flash or HTML5, and even sell them if we wish.

If, after publishing for Flash or HTML5, we find that a game is very popular, we can then pay for the appropriate Stencyl subscription and sell the game in the Apple App Store, or for Android devices in the Google Play store. We can learn how to use Stencyl and develop games for free to see if people like them, before paying for an annual subscription!

If you are a member of the Apple iOS Developer program, games can be created and tested for the Apple iOS devices with the free version of Stencyl, but they can't be published to the Apple App Store. In Chapter 10, Targeting Mobile Platforms, we'll look in more detail at the options available, and the requirements for publishing to mobile devices running iOS and Android.

Using the free version of Stencyl with this book

In order to follow the game development tutorials in this book, only the free version of Stencyl is required. Subscriptions to Stencyl are only necessary for publishing to mobile devices and desktop applications.

The following matrix shows the major differences between the free and subscription versions of Stencyl:

Please note that the previous matrix provides only a summary of differences between the available versions of Stencyl. It is vital to check the Stencyl website (www.stencyl.com) for the latest features prior to making a purchasing decision, as the feature list may have been updated since publication.