Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

thanks, this is just a prototype. 

First, the game itself has states, e.g. Intro where the blocks fall down in a cascade, 

for the cascading effect I use a for loop and a slight delay - here I create blocks that start falling with this delay

for(var i = 0; i < 8; i++) {

for(var j = 0; j < 8; j++) {

var delay = (i + j) * 3;

however, in the game outside the intro, the blocks just fall normally, without this cascading like in the intro.

var all_in_place = true;

for(var i = 0; i < 8; i++) {

for(var j = 0; j < 8; j++) {

if(instance_exists(game_brick[i,j])) {

if(game_brick[i,j].falling || game_brick[i,j].fall_delay > 0) {

all_in_place = false;

break;

}

}

}

if(!all_in_place) break;

}

if(all_in_place) {

game_state = GAMESTATE.PLAYING;

last_superpower_time = current_time;

}

exit;

}

Here the variable fall_delay is related to another problem that this variable solves, but it would take a lot of explaining.

for now i'm using a game controller and a brick object, but i'll change it to strucks soon to have only 1 controlling object. I use ds_stack, ds_lists and ds_grids.

Very clean code, love it!