Game Development Reference
In-Depth Information
Scrolling
Usually match-three puzzles wait for the player to tap the screen, but what would hap-
pen if the player were to drag his finger over the tiles? In a standard game mode, that
affects nothing; the game catches the first touch, ignoring the last part of the gesture.
That is not very interesting, but let's imagine a game where the drag gesture can have
real purpose. What can it do? Ordinarily, it is used to scroll some long content over the
screen; users push UI elements to give them some motion. Here the idea would work
like this: each row of the array with tiles is much wider than the screen—for instance,
it may include 30 elements—but a player sees only 8 tiles (the width of screen) and
he has to scroll a row left or right to see elements hidden beyond the screen frame. By
moving each row, the player can align tiles, forming new sequences. The row moves
with some inertia and acceleration; the game has some snapping mechanics to align
tiles correctly. Let's call this mode Scroll . As an option, rows can be shuffled at the
initialization of the game.
The roll call function does not begin its duty until rows completely stop and are ac-
curately aligned. It is preferable to use the passive array and to check the only row
that was scrolled and its neighbors. This makes the gameplay calm and staid. Active
arrays can be used too, but is better to use bigger arrays of tiles for such games be-
cause it eliminates items from the screen much faster.
There can be several ways for rows and columns to operate:
Fixed length of a line : A row or a column has a predefined collection of ele-
ments and can be scrolled from end to end; if it reaches one of its edges, the
scroll process stops, and the player should scroll it backward.
Looped line : The collection of elements is predefined too, but the line is
looped, so when it is scrolled till the end, the game begins to show tiles from
the beginning of the line. Therefore, the player can scroll in one direction only
(for instance, from right to left).
Search WWH ::




Custom Search