Tetris collision problem
Blitz3D Forums/Blitz3D Beginners Area/Tetris collision problem
| ||
I'm writing a 3D tetris-like game and have a problem. First, some background: I need each block in each formation to be a seperate entity. So I have a type for block, and a pivot object that each new formation is parented to when created. That way you can move and rotate entire formations. The problem is that I need to do block-to-block collision checking. If I try the standard collision routines, the falling formations don't work right because they're colliding against each other. If I disable block-to-block collisions, then there's no way of telling if that block formation hit the blocks already on the bottom. And if I try to do something like entity type block,0 ;do positioning of blocks based on pivot entitytype block,cBLOCK ;do block collision checking nothing works!! I haven't a clue how to proceed. Any help would be great! |
| ||
You could set all the fallen blocks to entitytype 2 and the falling blocks to entitytype 1 and only check for collisions between type 1 and type 2. That should solve your problem fine. Although, tetris is a simple game, with predetermined block widths and straight edges, which means having polygon collisions is slightly overkill. Instead, why not use the same method you would use to create a 2d version of tetris, with the array. You check the array for collisions instead. |
| ||
Yes, Tetris doesn't require collisions. Use an array as Ross says. |