Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 21st Jan 2004 18:48
Im a noob but I have made space invaders and want to make tetris but I can't work out how to make a complete row of block disapear and how do I + 10 to the score if a row of blocks are deleted?

just code
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 21st Jan 2004 19:46
It depends how you are storing the info about the blocks.
The most common way would be to use an array board(19,9) to represent each space in the board. use 1 for still blocks, 2 for falling blocks and 0 for no blocks.

Then it's just a matter of checking each row of the array for a line of still blocks, if there is a full row delete the blocks and move all blocks above the line down one, then just increase the score.

Can I scream?
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 21st Jan 2004 19:54
could you give me an example of the code coz I not very good at array's i've found them confusing before

just code
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 21st Jan 2004 20:04
Arrays are simple, and very helpful. Let's say you have 200 guests at your party. They all have different ages, now you want to print out all of those ages. How will you do that? Variables: Guest1,Guest2,Guest2 or Array: Guest(1),Guest(2).

It's really simple to read too:
for i=1 to 200
print Guest(i)," ";
next i

Dual AMD Athlon MP 2x1GHZ | IBM 15000Rpm SCSI 73.4 Gb X 2 | e-GeForce Ti4400 | Audigy 2 + 7.1 Surround sound | 17' Monitor | Ugly mouse
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 21st Jan 2004 20:13 Edited at: 21st Jan 2004 21:54
how would I do the 1 for still blocks , 2 for falling blocks , 0 for no blocks and how can I make show a block when it prints each array

just code
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Jan 2004 08:14
Basically, you have an array of the game grid. Once a block has locked into place, update the array and tell the appropriate array locations that that area is now occupied. Then you have your "check for row completion" method. This would just be a nested loop.
if your game grid is 10x20, then your array is:
dim grid(10,20)

to check for row completion, click the "source" icon.
You might be wondering why I have the "else exit" in the loop. If you come to a column in the row that isn't occupied, then exit the inner FOR loop. There's no sense in checking the rest of the row if you already know there's one unoccupied spot.

"eureka" - Archimedes
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Jan 2004 08:16
I was going to post my whole tetris source code, but I decided to let you try things out yourself first.

"eureka" - Archimedes
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 22nd Jan 2004 20:03
could you post your whole code so I can see how it all work and make and edited version.

just code
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 22nd Jan 2004 20:06
how do you edit the info of a box and make it show and move the block were neccessary also how do you make it move a line of 4 block?

just code
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Jan 2004 09:44 Edited at: 23rd Jan 2004 09:45
I should've used data commands at the end of my file instead. Those numbers at the bottom store all the rotations for all the different shapes. Each shape is made up of 4 squares. Just rem out the media usage, and you can run it. I never quite finished it yet. The game doesn't stop once you reach the top as it should.

"eureka" - Archimedes
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 23rd Jan 2004 11:09 Edited at: 23rd Jan 2004 20:08
could you go through the code and explain each part?
thanks.

just code
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 23rd Jan 2004 21:08
I get the next for loop and want must of the vairables are doing but the rest is confusing

just code
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Jan 2004 01:55
Basically, think of a 4x4 grid. The 0,1,2,3 for the arrays at the bottom designate which grid square a block will occupy at each of its rotations. The top left corner of the block grid(0,0) is positioned on the game grid with whatever coordinates you have. Like I said earlier, each shape was made up of 4 different blocks, or planes as I used. To position the 4 blocks accordingly, you take the block grid's position as a base a location, then offset the 4 blocks from it by multiplying each block's grid location by the actual size of the block itself.

"eureka" - Archimedes
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 24th Jan 2004 10:26
could you give an example of loading the image into the grid and offsetting it?
thanx

just code

Login to post a reply

Server time is: 2024-09-21 18:16:31
Your offset time is: 2024-09-21 18:16:31