Game Development Reference
In-Depth Information
LevelLogic fruitsGame blueprint
The construction of the component hierarchy is very simple. You must have the
Camera
component that will render the game. And you need to have a
TextRenderer
that will work
as the UI element to show the player score. And finally, you need several points in the
space to be used as spawn points for the fruits; in my case, I made seven points, all of them
are of the type
Billboard
.
The final look of the blueprint when you drop a copy of it into the base level scene should
look like this:
Before you start working on the logic part, you need to add several variables to be used
during the process of building the gameplay logic. So add an
int
variable, call it
playerS-
core
. It is to be used as storage for the score value.
Add an integer called
instancesAmount
to be used as storage for the number of fruits that
need to be spawned during the level. Add another integer called
instancingPoint
, which
will work as a random value for the spawn point to be used for the current spawn operation.
Another
int
called
fruitID
will be randomly changed, and its value will be used to ran-
domly pick a fruit or bomb to be spawned. Finally, a
location
variable named
tempLoca-
tion
will be used to store the spawn point.
Search WWH ::
Custom Search