Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Stencyl Essentials
  • Toc
  • feedback
Stencyl Essentials

Stencyl Essentials

By : Sneyd
4.4 (5)
close
Stencyl Essentials

Stencyl Essentials

4.4 (5)
By: Sneyd

Overview of this book

If you are a computer game enthusiast who has always wanted to know what it takes to build a playable game, or maybe you would like to expand your programming knowledge so that you can develop great computer games using a solid game engine and toolkit, then this book is for you.
Table of Contents (14 chapters)
close
13
Index

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

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete