candy crush style grid candies that drop smoothly?

Blitz3D Forums/Blitz3D Programming/candy crush style grid candies that drop smoothly?

andy_mc(Posted 2014) [#1]
I'm writing a candy crush style game, I'm using a 3d array for the grid, x,y,0 stores the item type in the cell and x,y,1 stores whether that cell is selected or not, when cells gets wiped the cells above get moved down to fill the spaces using a loop that loops through he grid dropping the fruits down.

How can I make the fruits drop down smoothly?

I start the game by dropping the whole grid smoothly down using gravity from the top of the screen but that's just by offsetting the Y value of the grid drawing line, how do I drop each fruit individually???


xlsior(Posted 2014) [#2]
You could add a flag to each candy stating whether or not it's currently dropping, and if so draw it at an increasing offset until it is where it should end up


andy_mc(Posted 2014) [#3]
thanks xlsior, that's my current thought on it