Game Development Reference
In-Depth Information
• The
Show Collectables
event is very simple, as I used a reference to all of the
collectables I have in the level and applied a node called
Set Visibility
to them
and marked its
New Visibility
variable to
True
. Now I make sure that when the
level starts to loop, it will reset the visibility of the collected items to show them
again and again make them available to be collected. (The pooling theory for bet-
ter performance in
Chapter 8
,
iOS Debugging and Optimization
). We can also use
a
for
loop during runtime to look for those collectables and reset them, but hav-
ing a reference for them before starting the level is a faster way than looking for
them during runtime.
• Using the
Space Bar
actions and the
Input Touch
actions is the easiest way to
set up a controller for the game quickly. As the game does not require on screen
joysticks, or for the player to tap on a specific area, both of those functions will
work fine to simulate the player pressing or tapping the screen. And as we are us-
ing the
Character
class to control the player's character, we have direct access to
a function called
Jump
, which will cause the player to jump with the specified
force in the
Movement component
.
• On
Event Tick
, we can check every frame to know whether the
Character
Movement
component of the
Character
class is moving on the ground, and us-
ing the returned Boolean value to control whether we will display a running anim-
Search WWH ::
Custom Search