I’m trying to make a simple Tetris like game with Javascript and the html 5 canvas tag. The idea is that two blocks will fall down at a time and you have to match together colours. When you get 4 colours in a row they will disappear and you get some points.
A block will fall as single rectangular object but when it touches the ground it is saved to an array and the block object properties are re-set so it begins the descent again. However my problem is that when the rectangular block collides with a block form the array the block it collided with disappears?
You can look at the source code here: http://jsfiddle.net/cEvbd/7/.
Basically can anybody see why this is happening and how I can fix it?
I found the problem with my code. very simply I was actually drawing a white block below each block meaning that you couldn’t see the block below.