Now that the necessary resources have been created, scripts can be written to lay out the initial pieces of this puzzle game. The first script will be the Create event of
obj_grid_manager. This script will define several variables within
obj_grid_manager. It will also execute
scr_create_in_grid to populate its pair of two-dimensional arrays.
The Create event of
obj_grid_manager will create the grid in which the objects are placed. The first portion of the code, shown as follows, will define several instanced variables that will be referenced throughout the game:
// Defines the number of columns in the grid. columns = 10; // Defines the number of rows in the grid. ...