Reader small image

You're reading from  Stencyl Essentials

Product typeBook
Published inApr 2015
Reading LevelBeginner
Publisher
ISBN-139781784399450
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Richard Sneyd
Richard Sneyd
author image
Richard Sneyd

Richard Sneyd (BA Hons.) is the founder and CEO of CyberMyth Games, an indie game development studio based in Country Cork, Ireland. His role within the company requires that he wears many hats, including that of a programmer, designer, digital 2D and 3D artist, sound designer, scriptwriter, texture artist, leader, marketer, and business man. He is also a fully registered, qualified, and highly experienced lecturer. His specialty subjects include 3D modeling and animation, computer game programming, 2D image processing, game design, desktop audio, psychology, consumer behavior, human resources, and business management. In addition to classroom teaching, he is actively involved in online education, regularly publishing new courses, and various other learning materials, such as books and tutorials, in conjunction with CyberMyth Games. He is enthusiastic about his work, and his students and colleagues think of him as a very dedicated and accomplished teacher. All of his courses and books are characterized by a steady, incremental flow of information, and a lucid teaching style that is easy to understand and follow for all. He is a husband to his wonderful wife, Jennifer, and father to a wonderful son, Darius.
Read more about Richard Sneyd

Right arrow

Adding player interaction


Before there can be any ostensible gameplay, we must accept and react to some form of player input. This gives the player some level of agency within the game. Let's learn how to do this now.

Initializing the variables

The very first thing we need to do is initialize the values of our attributes. We can do this when the actor is first loaded into the scene, using the When Creating event. Let's add a When Creating event to the Player Handler behavior now by performing the following steps:

  1. From the Dashboard, under LOGIC, select Actor Behaviors and open up the Player Handler behavior.

  2. Navigate to Add Event | Basics | When Creating to add a when created event to the behavior, as shown in the following screenshot:

  3. In the blocks Palette, select the Attributes tab, then click on Setters, and you will see a range of setters for each attribute, which we have already created, broken down into their attribute types, as shown in the following screenshot:

  4. Scroll down to the Number...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Stencyl Essentials
Published in: Apr 2015Publisher: ISBN-13: 9781784399450

Author (1)

author image
Richard Sneyd

Richard Sneyd (BA Hons.) is the founder and CEO of CyberMyth Games, an indie game development studio based in Country Cork, Ireland. His role within the company requires that he wears many hats, including that of a programmer, designer, digital 2D and 3D artist, sound designer, scriptwriter, texture artist, leader, marketer, and business man. He is also a fully registered, qualified, and highly experienced lecturer. His specialty subjects include 3D modeling and animation, computer game programming, 2D image processing, game design, desktop audio, psychology, consumer behavior, human resources, and business management. In addition to classroom teaching, he is actively involved in online education, regularly publishing new courses, and various other learning materials, such as books and tutorials, in conjunction with CyberMyth Games. He is enthusiastic about his work, and his students and colleagues think of him as a very dedicated and accomplished teacher. All of his courses and books are characterized by a steady, incremental flow of information, and a lucid teaching style that is easy to understand and follow for all. He is a husband to his wonderful wife, Jennifer, and father to a wonderful son, Darius.
Read more about Richard Sneyd