The document discusses actors and attributes in Gamesalad. Actors are everything that appears in a scene and are controlled using attributes. Attributes are values that control an actor's properties like size, color, physics, etc. Behaviors define an actor's logic through rules that contain conditions and actions. Conditions specify when a rule activates, like when a key is pressed. Actions are what the actor will do when conditions are met, like moving or changing color. Together, attributes and behaviors allow for programming actor properties and logic to create game interactions and mechanics.
1. ACTORS
Everything that appears in
a Gamesalad scene is an
actor. Each actor is
controlled with attributes.
Here is an example of one
of the actors in the Pong
game I made.
ATTRIBUTE
Opening up an Actors
settings will show some of
default the attributes.
Here there are attributes
set up for size, colour,
physics, graphics, name
and motion, all the things
needed to set up the actor
for the game.
Attributes are basically values or variables, so you can use
them to record conditions and data. The types are
ʻBooleanʼ, ʻIntegerʼ, ʻRealʼ, ʻAngleʼ and ʻTextʼ. Each kind of
attribute records different things; A ʻBooleanʼ is a simple
true or false represented by a tick box, so is this something
happening or not. ʻAngleʼ will record a degree on a circle,
and an ʻIntegerʼ records numbers that arenʼt decimals.
As well as the default attributes in the actor settings, you
can create new ones of any kind for actors and for the
game as a whole, and name them.
ʻRealʼ attributes control the size of
the Actor, one for both the Width and
Height.
An important part of the actorsʼ attributes
is the physics section. Here you can
control the physics of the actor, how it
interacts with the world and other actors.
ʻDensityʼ will control how dense the actor
is, so heaviness. Then thereʼs Friction,
basically how much contact with other
actors will slow the movement down.
And Bounciness, which sets how much the
actor will bounce when colliding with
things.
You can also use a tick box to choose if
the actor is moveable or not, if set to not
the actor is fixed to the spot.
Theres also a Collision Shape, which sets
up the shape around the Actor, used to
determine if itʼs colliding with something.
In the colour you can set the actors
basic colour. You can also control itʼs
opacity by changing the value of the
ʻAlphaʼ attribute.
2. The top section of a rule is the
Conditions section. Basically this
section asks “what needs to be
happening for this rule activate?”
The bottom half is the ʻActionsʼ
section. Here you drag in the actions
you want to happen once the
conditions are met.
BEHAVIORS
Behaviors are the logic of an Actor. Here is a Rule set up
for the Paddle Player 1 actor. Ruleʼs are blocks that
contain first conditions and behaviors. These rules tell
the Actor what they are supposed to do when certain
conditions occur.
Lastly, at the bottom of the rule,
thereʼs an ʻOtherwiseʼ section. This
part of the rule dictates what the
actor should if the conditions arenʼt
being met.
The one/off button you
can switch the rule off
without deleting it. This
can be useful for tracking down
bugs in the game.
Here you can set if the condition is when
the actor receives an event, or if itʼs based
on an attribute. A received event is
something like a key being pressed or a collision with another
actor.
If itʼs based on an attribute then you can set which attribute
the condition looks at, and then it tell it to check itʼs state. E.g.
the condition could be, this boolean I created must be true.
Theres a little box to select ʻAllʼ or
ʻAnyʼ. This means you can choose if
all the conditions must be being met
to activate the rule, or if the rule will
start if any one of them is met.
Here iʼve used a ʻKeyʼ condition,
meaning that the condition is that a
certain key is pressed, here the ʻWʼ
key. You can also set if the rule
activates when the key is down or if
it starts when its up, so if itʼs being
pressed or not.
another options for the condition is
ʻOverlaps or Collidesʼ, which looks if
the actor is colliding with another set
actor.
There are different actions or ʻBehaviorsʼ that can be selected from
a list and dragged into the Actions section of a rule. The example
here is a ʻMoveʼ behavior, which moves the actor in a set direction,
at a set speed when the conditions of the rule are met. You can
drag as many behaviors as you like into the actions section of a
rule, and they will all be executed with the rule activates.