Game Development Reference
In-Depth Information
About Object-Oriented Programming:
Object-oriented programming (OOP) is a programming concept
centered on objects. An object is a data structure that contains
descriptive information about the object as well as actions (called
methods). OOP is out of the scope of this topic, but perhaps you've
noticed the resemblance between OOP and GameSalad. Actors are
the objects, attributes are the descriptive information, and behaviors
are the methods. In reality, this is no surprise. GameSalad only hides
the programming aspects of iOS development! The iOS development
language is Objective-C, and guess what? Objective-C is an object-
oriented programming language.
If you need to modify some attributes or a behavior of a specific instance, you
must unlock the instance to access its attributes and behaviors. Scene
attributes, such as camera or orientation attributes, can only be accessed from
actors located on the scene. As such, you will need to edit the actor instances.
Actor Attributes
To best understand the concept of actor attributes, you need to think about
attributes as items that describe the actor. For example, to describe a human
actor, you would mention hair color (blond, brown, grey, dark, or none), eye
color (blue, brown, green), etc. Thus an attribute is a characteristic of the item
and its value.
So what does this mean in GameSalad? Let's say that you have an actor called
Ball. It can be moveable (yes or no), it has a height and width, a color, etc.
Commonly Used Attributes
Let's quickly review the most important attributes of an actor. Those attributes
are accessible from the Actor Editor shown in Figure 2-9.
Name
This field contains the name of the actor. Use specific names; this is especially
important if you will have many actors in your project.
 
Search WWH ::




Custom Search