Page 1 of 1

Help whit a Tetris game type.

PostPosted: Sun Nov 12, 2006 1:05 am
by Game A Gogo
ok, me and Jaco Pastorius is working on a game called metris, but, we got a major problem here, we don't know how to make the line Disappear after their made, I thought of scrolling the whole game down, but what if the guy makes a line in the middle? i thought a long while for this one, the only way, the insane way we thought of was, like making the block multiple actor, and deleting the needed actor for the line, but for scrolling it, AHHH, this one gives me a headache, hope you can help.

PostPosted: Sun Nov 12, 2006 9:20 am
by Novice
What line??? What does your game look like???
What type of game are you making??? What block???
No one can help you if don't give us some info. :?

PostPosted: Sun Nov 12, 2006 9:56 pm
by Game A Gogo
well if you would read the title, it woiuld say what kind of game it is.

PostPosted: Mon Nov 13, 2006 9:26 am
by Novice
Oops :oops: :oops:
Sorry about that, i read it also metris, i even did a google search to find what it is.
You can make your line disappear buy storing your whole level in a multidimensional array, and then checking if a line has been made, something like this.

00000
00000
00000
10010
11111
10110
Code: Select all
if (array[0][5]==1&&array[1][5]==1...&&array[4][5]==1)
{
     //make the blocks above come down one level and add points
}

This would be done easier using a while statement to check all rows for a complete line.
Again sorry for the misunderstanding.

PostPosted: Mon Nov 13, 2006 11:57 pm
by Game A Gogo
its ok, but, its no use...

Anyway, the only visually way to do this, is by making each block with multiple actor, but then, for the rotating thing, ahhh, yeah, TT

PostPosted: Tue Nov 14, 2006 1:29 am
by DilloDude
The rotating thing would be a pain. Perhaps, make for each shape block one animation with all rotations, and have script to convert each square to an array. So the block knows what space it occupies. Make tha stack at the bottom a text actor, and when the block touches the stack, it goes through a script to update the text, and then destroys itself. Then the text checks for a complete row and then updates itself again. Try fiddling with this idea. Just remember that text can only have 255 characters, so if you want more than that (remembering to leave space for the newline character), you may need to have an array of text actors, each representing 5 or so rows (depending on the size).

PostPosted: Tue Nov 14, 2006 9:51 pm
by Fuzzy
rotation is easy. since the rotations happen in 90 degree steps, rather than interpolated at x degrees, you have every and all shape be a base actor that stores its rotation. One byte would do easily.

The base actor knows where it should be next draw event, and it knows how to draw itself based on its angle. It examines its angle and creates appendage actors that are parented to it with the ruleset for that angle. at the same time, it detroys the old arms from the last angle.

Then it examines the area below it, and if it is open, it moves downward.

Re: Help whit a Tetris game type.

PostPosted: Wed Jun 18, 2008 2:27 pm
by xr2alex99
well maybe the filled region may help
at the bottom add the line thing and if the line is (filled region) filled then everything in it is destroyed

Re: Help whit a Tetris game type.

PostPosted: Thu Jun 26, 2008 2:44 pm
by Thanx
Here's my idea:

The gameplay is made up of clones, nothing will have to move, each clone has the animations it might need.

Next, you'll need an array, for the gameplay, basically describing where there's a block, where there isn't.

Then for the shapes falling down you need a small array, the size of howmany squares the shape's out of. Each variable in the array contains the position of that square on map. (the cloneindex of the clone showing its animation). Each rotation you'll change thes numbers.

Each step if the space is free under it,you add to the numbers of the shape array the width of the board (that'll give the squares 1 row beneath the ones in the earlier turn.

to check wether there's space beneath, you'll have to use the board's array to help, but that shouldn't be too complicated.

If it reached the bottom, simply refill the shape's array, without changing the filledness of the ealier squares you were working with, to keep the old shape in place.

To check wether a line is full, divide the board into lines. E.g. the board's width is 10, then divide it to 0-9, 10-19, etc. And check wether they're all filled. (Using the board's array).
If a ine were to be filled copy the rows above to the row below, and so on, and the new row should be all open, as you know.

I think that's what has to be done, this is the way I'd do it...
Hope this helped,
Thanx