Chapter 3. Add Row
For a typical match-3 game, new random chess should be added while user removed chess from board. In this chapter we will realize this function.
Change to <Event sheet 1> and add following codes:
Event#20 defines a function named "add_row". In this event we use <GridMove> to force all chess to move up 1 grid first. And then create one row chess at the bottom (y = Board.BoardHeight - 1) with their animation set randomly.
Look at Event#19, when all the chess removal is done, we call "add_row" to insert one row at the bottom of the board, then call "loop" to match again.
Push <F4> to run layout, congratulations! Now your game can match, remove, dropdown, and add a new row. See how many events you've use? Only 21, that's great!
In next tutorial we will make a FSM (finite state machine) on top of those functions you've made ("match3", "matchL"...). And we will also finish this Poptile game and wrap things up.
Hope you'll like this tutorial. See you soon!
Part 4 is here.