H
H
HeroYukki2019-02-26 19:14:21
Unity
HeroYukki, 2019-02-26 19:14:21

How to check the presence of a neighboring object in the game Fifteen?

There is a game of the type of tags.
At the moment, a field of clones of the initial element 5x5 is being generated, the movement of elements is carried out by a banal exchange of coordinates through containers. However, the range of movement of objects is not limited by anything, i.e. it is permissible to move both neighboring elements, and through one, two or more blocks. It is necessary to limit the range of movement of objects.
If I understand everything correctly, you need to somehow refer to the neighboring element. Tell me, which operator is correct to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2019-02-26
@longclaps

you need to somehow refer to the neighboring element of the array. Tell me, which operator is correct to do this?

The operator for accessing an array element is called "square brackets".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question