timing for tetris
I CANT FIND ANYONE W/ A COPY OF TETRIS FOR GAMEBOY!!! AHHHH!
anyway, anyone know about what the timing is for tetris? Like the drop time per level? how ''bout the scoring system.
i''m just gonna make my own, but i''d rather get close to the orig, at least...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no name that you may call me. I am merely Succinct.
~Succinct Demos Online~
"Hey, where''d that display list rotate off to now?"
-(Drop me a line here)-
-- Succinct(Don't listen to me)
Finally another one that is doing a tetris
I don''t have the exact timing but I thought we maybe could exchange other ideas (about rotation of the blocks, the collision detection, the linechecking or something other I can''t remember right now
mail:
eywox@usa.net
I don''t have the exact timing but I thought we maybe could exchange other ideas (about rotation of the blocks, the collision detection, the linechecking or something other I can''t remember right now
mail:
eywox@usa.net
Kewl!
my lil game''s 90% done, all i gotta do is add the means for choosing a level in the beginning and fix the scoring/timing to be more realistic.
now, for straight 2d tetris (2d w/ 3d effects is different), here''s how i set up all of my collisions/rotations etc. i don''t know how the original russian dude did it, but this way is pretty simplistic... so i don''t imagine it was much different
alrigh, basically what i did was i set up a few different grids.
by grid i mean a little 2d array, but for this situation, the grid idea seems to be more appropriate
the main grid is the "playing board". this is where all of the pieces go and is what''s displayed every frame.
additionally, for each piece, i set up another grid w/ w and h 4 (the max size of each piece, measured in blocks).
soo, what happens is you get the empty game grid, find where the piece is going to start, and copy it from the piece''s grid to the game grid. if any blocks overlap, there''s a collision
that should be enough to give ya the idea how i did my collisions, etc. i got a post of it on my demo site if ya wanna see it. (it''s a 2d w/ 3d special effects, so just the grid/grid way doesn''t work 100% (thus i changed it ) )
my lil game''s 90% done, all i gotta do is add the means for choosing a level in the beginning and fix the scoring/timing to be more realistic.
now, for straight 2d tetris (2d w/ 3d effects is different), here''s how i set up all of my collisions/rotations etc. i don''t know how the original russian dude did it, but this way is pretty simplistic... so i don''t imagine it was much different
alrigh, basically what i did was i set up a few different grids.
by grid i mean a little 2d array, but for this situation, the grid idea seems to be more appropriate
the main grid is the "playing board". this is where all of the pieces go and is what''s displayed every frame.
additionally, for each piece, i set up another grid w/ w and h 4 (the max size of each piece, measured in blocks).
soo, what happens is you get the empty game grid, find where the piece is going to start, and copy it from the piece''s grid to the game grid. if any blocks overlap, there''s a collision
that should be enough to give ya the idea how i did my collisions, etc. i got a post of it on my demo site if ya wanna see it. (it''s a 2d w/ 3d special effects, so just the grid/grid way doesn''t work 100% (thus i changed it ) )
-- Succinct(Don't listen to me)
p.s. the rotation is just done by rotating the 4x4 grid and then translating
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no name that you may call me. I am merely Succinct.
~Succinct Demos Online~
"Hey, where''d that display list rotate off to now?"
-(Drop me a line here)-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no name that you may call me. I am merely Succinct.
~Succinct Demos Online~
"Hey, where''d that display list rotate off to now?"
-(Drop me a line here)-
-- Succinct(Don't listen to me)
I''m writing a Tetris game too! I have actually basically finished a Tetris game engine that works very well and has been met by high praise, even from ppl who are normally a-holes towards stuff like this. I am however planning to propel this game much further, adding a slew of cool features i dont want to divulge right now
Anyway, first of all, I must say the original Tetris wasn''t all that great. Aside from being in text mode (no great sin), it didn''t feel all that "right". My favorite Tetris clone (aside from my own, which i seriously enjoy playing) is in Microsoft''s Game Pack, back from the days of Windows 3.1. It has the most absolutely beautiful feel, and no clone has ever come to matching how nice it plays, even though it doesn''t have all that many features. My clone''s control feels quite the same. Other clones feel different. My point is that there aren''t necessarily any strict numbers to use for the tetris timing and scoring. Your making a clone, might as well excercise creative freedom!
However, here''s what I found to work best, but I am merely human and thus are as likely as not to be in error:
grid is 10x20 blocks (this seems to be all tetris games except with the very odd exception) for standard play
blocks do not fall smoothly. they fall grid position by grid position, not pixel by pixel, unlike games like pacman, where smooth movement is employed.
Scoring is affected by level, how many rows block fell at "quick drop", how many rows were eliminated at once (ive seen games that penalize u for elimating a lot of rows at a time), and depending on the clone, some other things too
Timing - I just use a 55 millisecond ticker (finest timing u can get without using multimedia timer, and more than enuff), so every 55 milliseconds, an update function is called. This function combines these 55 millisecond "ticks" with a speed multiplier that is based on the current level.
Rotation - make it feel natural. a block should rotate, not rotate and move. My tetris game represents all blocks as 4x4 grids. Values of 0 are "no block there". This requires a bit of thinking when creating all the rotations of blocks (created beforehand in block editor to allow more versatality instead of using a general algorithm which was screwing up some blocks and making them rotate unnaturally). Getting the right feel to the game is crucical.
The above may seem obvious to casual readers, but it took some reserach (mainly a helluva lot of games of tetris )
Hope that helps, or at least inspires.
Anyway, first of all, I must say the original Tetris wasn''t all that great. Aside from being in text mode (no great sin), it didn''t feel all that "right". My favorite Tetris clone (aside from my own, which i seriously enjoy playing) is in Microsoft''s Game Pack, back from the days of Windows 3.1. It has the most absolutely beautiful feel, and no clone has ever come to matching how nice it plays, even though it doesn''t have all that many features. My clone''s control feels quite the same. Other clones feel different. My point is that there aren''t necessarily any strict numbers to use for the tetris timing and scoring. Your making a clone, might as well excercise creative freedom!
However, here''s what I found to work best, but I am merely human and thus are as likely as not to be in error:
grid is 10x20 blocks (this seems to be all tetris games except with the very odd exception) for standard play
blocks do not fall smoothly. they fall grid position by grid position, not pixel by pixel, unlike games like pacman, where smooth movement is employed.
Scoring is affected by level, how many rows block fell at "quick drop", how many rows were eliminated at once (ive seen games that penalize u for elimating a lot of rows at a time), and depending on the clone, some other things too
Timing - I just use a 55 millisecond ticker (finest timing u can get without using multimedia timer, and more than enuff), so every 55 milliseconds, an update function is called. This function combines these 55 millisecond "ticks" with a speed multiplier that is based on the current level.
Rotation - make it feel natural. a block should rotate, not rotate and move. My tetris game represents all blocks as 4x4 grids. Values of 0 are "no block there". This requires a bit of thinking when creating all the rotations of blocks (created beforehand in block editor to allow more versatality instead of using a general algorithm which was screwing up some blocks and making them rotate unnaturally). Getting the right feel to the game is crucical.
The above may seem obvious to casual readers, but it took some reserach (mainly a helluva lot of games of tetris )
Hope that helps, or at least inspires.
BetaShare - Run Your Beta Right!
Well currently I read C++ in school so I thought it would be a good idea to use classes, I use one class for the block and another for the formation of blocks(it contains four blocks). To rotate I have setup an array that contains all the different positions that all the blocks have in different rotations, and then I just change a rotationcounter ( alot of work but this is my first real project in C++)
As for the collision-detection I just compare all the nonmoving block''s coordinates with the movingblock''s
I do have checked other clones out and it seems that the grid idea would be best to use, but what the hell I,ve learned a lot about classes and such
As for the collision-detection I just compare all the nonmoving block''s coordinates with the movingblock''s
I do have checked other clones out and it seems that the grid idea would be best to use, but what the hell I,ve learned a lot about classes and such
Hmmm, thinking in terms of speed and practicality, i don''t think you need to make 1000 classes just to have blocks fall
There isn''t much advantage that i can see in making every little square a class, and then making another class for the blocks of squares, and then presumably another class for the tetris game itself. Seems rather awkward and more work than necessary. Making everything object oriented was something i kept wanting to do when learning C++, and some ppl will go on saying that is how things should be, but imho the middle path approach is best. It makes sense to seperate ur program into classes, but it doesnt make sense to over do it for the sake of doing it.
I actually only have one class for my Tetris engine, and it does me fine. Sadly it is written in VB because i am doing this for school (i shall repent, i promise), so that kinda alters some of the way i structured my program, but the overall skeleton would look fairly the same if i did it in C++.
Anyway, what i do is have one class for my tetris game. This class handles everything tetris except for input. The program using the class must call methods in the class whenever a key is pressed, or it is time to move the blocks. This allows the engine to be flexible for what kind of input/timing it uses, and the resulting program structure is very nice to work with. I use what in C++ would be Structs. Arrays are used to represent the sets of block pieces.
If your planning on making a really complex tetris game, then maybe some sort of block class might be in order, but i really think a Struct is better (and easier to do)
There isn''t much advantage that i can see in making every little square a class, and then making another class for the blocks of squares, and then presumably another class for the tetris game itself. Seems rather awkward and more work than necessary. Making everything object oriented was something i kept wanting to do when learning C++, and some ppl will go on saying that is how things should be, but imho the middle path approach is best. It makes sense to seperate ur program into classes, but it doesnt make sense to over do it for the sake of doing it.
I actually only have one class for my Tetris engine, and it does me fine. Sadly it is written in VB because i am doing this for school (i shall repent, i promise), so that kinda alters some of the way i structured my program, but the overall skeleton would look fairly the same if i did it in C++.
Anyway, what i do is have one class for my tetris game. This class handles everything tetris except for input. The program using the class must call methods in the class whenever a key is pressed, or it is time to move the blocks. This allows the engine to be flexible for what kind of input/timing it uses, and the resulting program structure is very nice to work with. I use what in C++ would be Structs. Arrays are used to represent the sets of block pieces.
If your planning on making a really complex tetris game, then maybe some sort of block class might be in order, but i really think a Struct is better (and easier to do)
BetaShare - Run Your Beta Right!
i done a short version of the game a couple of months ago . source is included from me site. youre welcome to build on it it improve it.
http://members.xoom.com/myBollux
http://members.xoom.com/myBollux
November 23, 2000 03:26 AM
well, for a tetris i,m sure an array of structs would be better then a class, but i think it works fine with a block class and a sprite class (the square) and besides an object doesn''t take much more memory than a struct does so it doesn''t really slow down things
but of course i have to call a function for every block that in turn calls four functions (one on every sprite object) only to draw things on the screen so I guess it isn''t the very best way of doing things
but I''m planning on doing more complicated games soon and then I think can have some use of my classes, one for the maincharacter one for the enemy one for the world or something...
I really don''t know but it seems there would be no use to have classes if you just do one big class, can''t you just do it all in the main loop of the game then with functions like in C...
but of course i have to call a function for every block that in turn calls four functions (one on every sprite object) only to draw things on the screen so I guess it isn''t the very best way of doing things
but I''m planning on doing more complicated games soon and then I think can have some use of my classes, one for the maincharacter one for the enemy one for the world or something...
I really don''t know but it seems there would be no use to have classes if you just do one big class, can''t you just do it all in the main loop of the game then with functions like in C...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement