Game Development Reference
In-Depth Information
The layout blueprint graph
Before you start working with this section, you need to make several copies of the materi-
al we made earlier and give each one its own color. I made six different ones to give a
variation of six colors to the blocks.
The scripts here will be responsible for creating the blocks, changing their colors, and fi-
nally, setting the game view to the current camera. To serve this goal, you need to add sev-
eral variables with several types. Here are some variables:
numberOfColumns : This is an integer variable that has a default value of six,
which is the total number of columns per row.
currentProgressBlockPosition : This is a vector type variable to hold the position
of the last created block. It is very important because you are going to add blocks
one after the other, so you want to define the position of the last block and then
add spacing to it.
aBlockMaterial : This is the material that will be applied to a specific block.
materialRandomIndex : This is a random integer value to be used for procedural
selected colors for each block.
To make things more organized, I managed to make several custom events. You can think
about them as a set of functions; each one has a block of procedurals to execute:
Initialize The Blocks : This Custom Event node has a set of for loops that are
working one by one on initializing the target blocks when the game starts. Each
loop cycles six times from Index 0 to the number of columns index. When it is
finished, it runs the next loop. Each loop body is a custom function itself, and
they all run the same set of procedurals, except that they use a different row.
chooseRandomMaterial : This custom event handles the process of picking a
random material to be applied to in the process of creation. It works by setting a
random value between 1 and 6 to the materialRandomIndex variable, and de-
Search WWH ::




Custom Search