Game Development Reference
In-Depth Information
Power ups, ammo, and inventory
The weapon we gave Kevin is a great gun, but there are always bigger and better
ones out there! Plus, we are going to make Kevin darn powerful with some cool
power ups because he's really going to need them in his journey. By now, things are
simple enough and you should be able to create things with no problem, but in case
you don't, let's do a couple power ups for Kevin. One will increase his armor and the
second will make him invisible for ten seconds.
Let's start with the armor power up. I have created a simple image for the power
up. Import it and create a new actor from it. Drag it somewhere into your scene,
preferably somewhere out of the way to make it challenging for the player to reach.
Double-click on the actor within the Inspector window so we can edit it.
I changed the Blending mode under the Graphics drop down to Additive to make
it look like it's glowing. Now all we have to do is create a rule, change it to Actor
receives event | collides or overlaps | with actor of type | Kevin , then drag in a
Destroy behavior into the Rule.
Now in our Kevin actor, we will create a similar rule, but instead, we will have it
colliding with the armor power up actor, and then inside the rule, we will drag
in a Change Attribute behavior and change it to Change Attribute: Game.Shields |
to: 100 .
Easy! Now Kevin has shields. In the next chapter, when we start creating our
baddies, we will discuss his shields a little further, but for now, he has them.
Now for a "Super Mario-esque" star that will keep Kevin invincible for ten seconds,
I think it would be cool if you shoot a treasure chest and it spawns the star.
I have also created an image for the star. Import it into GameSalad and create
an actor for it. We will import the treasure chest used earlier into the scene. Let's
double-click on it to edit it. Create a new rule, and change it to Actor Receives event
| overlaps or collides | with actor of type | GravRound , then drag in a Spawn
Actor behavior and select the Star actor, and then drag in a Destroy behavior.
 
Search WWH ::




Custom Search