Advertisement

Tile-based puzzler

Started by July 31, 2000 04:51 PM
2 comments, last by teethgrinder 24 years, 4 months ago
I''m working on my first game. After playing around with a few ideas, I''ve decided that a Tetris-type game would be the way to go. I''ve had several ideas about drawing the screen setting up a timer, etc. My main problem is colision detection. I''ve considered several methods, and the two I''m considering the most are as follows: A) All the tetranimos(sp?) can fit in a 24x24 bmp(if each block is 6x6), but then I have some problems with rotation, I can''t find a colision detection other than pixel-perfect, and I don''t want to get that deep for my first game. B) Another thought I had was to have a templated background (the tetris well, the score, level, etc. and then use 6x6 blocks for the tetranimos. I''m leaning more and more towards B, but I''m curious if anyone has a better suggestion. Thanks, me
This topic should be reposted in a different forum (like theory), you would get more replies.

I would go with choice ''b''.

Find a way to store tetris block data in an easy manor (array of bool''s?), then just track which blocks are falling and move them down, but if a block below is filled (if map[blockx][blocky + 1] == true) then stop the tetris peice, check for full lines, and get a new piece. You might want to make an array of something else though (bytes/ints/whatever) and just make value 0 equal no block, but anything over zero a block filled and have different values to show different colored blocks. Just some ideas.
___________________________Freeware development:ruinedsoft.com
Advertisement
I would suggest making a char array for the teris board. Have 0 = empty, and say 1-10 equal to colors (or however many you need). Then just update this array every frame using what iwasbiggs suggested. Then when you draw just do a double for loop through the array and blit the appropriate block based on the array # to look into a sprite



ByteMe95::~ByteMe95()
ByteMe95::~ByteMe95()My S(h)ite
I''m amazed at how quickly you guys responded. Yes I think I will go ahead and post this on the theory board just because I''m curious, but it seems you have pretty well answered my question. Thanks again

me

This topic is closed to new replies.

Advertisement