Q: how to make a tetris-like game?

A question to all BGE gurus out there:

how can I make a tetris-like game?

I’ve figured pretty much everything (yeah, like it was any difficult or sth) except how to make a certain line (=block alignment) disappear when it is filled horizontally. I guess once I figure out how to make one line disappear it should be easy to generalize to four lines (hence tetris).
Do I need python for that or are there any logic brick shortcuts?
Any help/tips/ideas are welcome.

raycast. .

An easy solution is this:
have the same number of empties as the width of the block line
each one has a ray sensor.
make a secret script that checks if all the ray sensors detect a block, if so it destroys the block part.

How about doing it programmatically using a line*column array that represents the status of every cube making up every tetrimino. Say you have a value of 1 for a cube and 0 for no cube. Every time a cube hits something other than the side walls, simply do a quick loop through the entire array looking for full lines, end the 4 objects representing the tetrimino’s cubes, move all cubes above down 1 line and update the array accordingly.
I think this would be more efficient and easier on the BGE.

the ray sensor can count how many objects it is penetrating, check if it penetrates the right number say for second, that would be easy to do. good luck.

Thanx for responding guys! :slight_smile:

I don’t even know what a raycast is but, oh well, I’ll look it up.

I think I understand the general idea of how to start and that’s enough for now.
Will probably bug you again if things don’t work.