Designing Games with Game Maker
GridsA grid is simply a two-dimensional array. A grid has an integer width and height. The structure allows you to set and retrieve the value of cells in the grid by giving the index of it (which starts with 0 in both the x- and the y-direction). But you can also set the value in regions, add values, and retrieve the sum, max, min, and mean value over a region. The structure is useful to represent e.g. a playing field. Even though all functionality can also be achieved using two-dimensional arrays, the operations on regions are a lot faster. The following functions exist:
ds_grid_create(w, h) Creates a new grid with the indicated width and height. The function returns an integer as an id that must be used in all other functions to access the particular grid. |
Alternative versions
|
You can also read this manual on one single long page (± 1.5 mb) Also available in: ![]() Download helpfile
|





