Game Development Reference
In-Depth Information
Now all you have to do is create an ammo power up so that when Kevin collides
with it, it will replenish his ammo. Check out the
Power ups, ammo, and inventory
section in this chapter to see how to do it.
Want different guns? Easy! Let me show you how. Let's say after this level you go
to a town and in that town, you will have a merchant who will sell you supplies. I
created a new level, populated it a bit, and created a merchant actor. The merchant
will have three new Booleans; one for his speech so the conversation only comes up
once after which the player will have to press a button to interact with him, another
for
Accepted
, and the last for
Declined
.
First, we will create a new
Rule
,
Actor receives event
|
overlaps or collides
|
with
actor of type
|
Kevin
, then drag in a Change Attribute behavior, and it will be
Change Attribute:
self.Speaking
|
to
|
true
.
Create another rule,
Attribute
|
self.Speaking
|
is
|
true
, with two more
conditions;
self.Accepted
is
False
, and
self.Declined
is
False
. Then drag in a
Display Text behavior and type in something like, "Hey I've got a nice upgrade for
that piece, only 500 coins. Press Y to buy or N to decline."