Game Development Reference
In-Depth Information
•
Shoot Some Fruits
: The first thing to do is defining how many fruit/bombs we
are going to shoot during this level using the
Set
node for the
instancesAmount
variable. I set it to
70
as it gives 4 minutes of gameplay approximately, which is
not a long or short level. Using a
for
loop (the custom one we made which has
the delay inside its logic) and adding the
instancesAmount
variable as its
Last
Index
will guarantee us the game will fire the shot even for fruits with the same
amount we defined. For loops are the best! Then call a custom event called
pick-
TheRandomSpawnPoint
, which I'll break down in a moment, but for now, this
function is responsible for picking a spawn point out of the seven we have and us-
ing it for the current spawning operation.
Finally, start executing several compare loops to check the random
fruitID
value. And ac-
cording to the value, the blueprint will be spawning a different fruit blueprint using the
SpawnActor
node using
tempLocation
(we set its value in the
pickTheRandomS-
pawnPoint
function) as its spawn location.
Search WWH ::
Custom Search