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.

DarkBASIC Discussion / tetris help

Author
Message
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 10th Apr 2007 02:15
ok... i can't figure out how to get the blocks to fall down... and to make the next block appear in the next block box... here is my code and media... and maybie ya'll can help me... thanx



Why do they turn against me? Especially when i need them the most?

Attachments

Login to view attachments
LBFN
18
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 10th Apr 2007 06:35
I did not see in your program where you put in for the blocks to fall down. I made some edits to your code to at least put in where the blocks would fall. You cannot turn the blocks or move them left/right, and also there is no check to see if the block has fallen upon another block, so there still is a fair amount of work to do.

I noticed your program had a dreaded goto statement and I took it out in the edit. Gotos will tend toward 'spaghetti code' and you really don't want that when you are trying to figure out a bug. Right now, there is no way to lose the game, so the program never returns from the main loop.

I also put in a select / endselect with case / endcase in your menu code. Check this out, it makes for neater code. You could use the same method for the menu text also.



Also, when the 'next block' is placed on the screen, I used a box colored with gray 'ink rgb(128,128,128),0' as a background for the next block. I would use your paint program to fill in the next block area with this color on your 'gamescreen' bitmap so you don't have gaps at the top and bottom (the corners were rounded so I couldn't make the box to fill it).

Hope this is of some help to you.

LB
LBFN
18
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 12th Apr 2007 02:37
@ hpfan 273
So, what's up? Did this help or not? I did put a little effort in here.

LB

Login to post a reply

Server time is: 2025-05-27 22:56:30
Your offset time is: 2025-05-27 22:56:30