Sometimes this means one page of a website, or it could mean one particular function of a whole program. For those that don't know, a variable with local scope will only function within the confines of where it's created. For those of you who know a bit of programming, you already know where this is heading. Getters and setters in stencyl are the equivalent of a variable with local scope in an actual programming language.
![stencyl health bar stencyl health bar](http://www.jscears.com/uploads/3/4/2/7/3427154/editor/alienescape-logo-01.png)
The Difference Between Getters/Setters and Game Attributesīefore we get started putting our blocks together, we need to discuss the difference between getter/setters, and game attributes. Once all of our character specs have been incremented, it will create a new $NextLevel value, so that the behavior can once again begin to watch for a new level up instance. It will then increment all of our other character attributes, like attack, defense, and max health. Once the experience surpasses the quota for the next level, it will increment our level up one. This behavior will watch for one variable ($experience) to become greater than, or equal to, another variable ($NextLevel). We are basically going to create a character behavior to attach to our main actor, or playable character. Today, we are going to go in depth on the first idea I stated, a classic RPG style level up system. We will cover building a skill tree of that nature in another tutorial here in a few days. This style of character building is more commonly known as role playing (RPG - role playing game).Īnother type of character building would be acquiring experience in one form or another, and then using that to purchase upgraded abilities (Dante's Inferno). That experience usually translates into higher attack power, higher defense, new magical abilities etc. To be concise, when I say character building, I mean that the particular game in question has a built in system where your character accumulates experience. Even first person shooters are beginning to adopt character building principles (think Borderlands). Over the past decade we are seeing more and more games of different genre's dip into the realm of character building. Character building is the backbone of every great RPG game ever made.It's not only for RPG's, though.