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.

Newcomers DBPro Corner / Any one for tetris?

Author
Message
super_tornado_
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location:
Posted: 18th Oct 2003 17:49 Edited at: 18th Oct 2003 17:52
Im a newb, but i still know a bit of code.
For my first game i was thinking of making a v.simple tetris game
No levels of changes of speeds just to keep it simple.

Does any1 have a short bit of code to get me started or ideas of where to start

Thankz

p.s i have dark basic classic
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 18th Oct 2003 19:24 Edited at: 18th Oct 2003 19:31
Lots of people made tetris for a retro competion a while back. I think most of them had the source code included, though they would probably be quite complicated. Not sure if you can still download them, though if you want I can email one of them to you.



super_tornado_
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location:
Posted: 18th Oct 2003 21:15
that would be great
thanks
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 19th Oct 2003 10:10
Well i don't know your e-mail, so i'll post the code here. Below is the code copied from the retro competion number 41 Tetris by Chris. I think at the momment it only works on DBC. And you'll need to create a nother empty file called "tetris.rand" in the same folder. It not eactly a short piece of code, 500 lines, good luck!

Darkflame
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location:
Posted: 20th Oct 2003 16:04 Edited at: 20th Oct 2003 16:07
Tetris is quite tricky to start with, Pong would be a better start.
---
*I would make tetris by making a 2D array, filled with 0's.
A random paturn of 4 blocks apears at the top of it, assigned 1's.

*Each loop the blocks with 1 assigned to them move down..unless there is a 2 under them or they reach the ground.
If this happens they become 2 as well.

*If the user hits left or right all the 1's in the array move left or right one.
If the user rotates, there is a mirror/flipping subrouting applied to the falling paturn of 1's. (you cant actualy rotate discrite data).

*If there is a row of 2's found, then they vanish, and *all* the rows above becomes 1's.(and they then fall down...see above)

The array would of course, be drawen to the screen once per cycle.
=====
This is how i would make Tetris..not sure if its the best way.
For one thing, the movement is jerky, smooth falling would be nicer.

"The man who says it cannot be done is generally interrupted by someone doing it." ~ Elbert Hubbard
super_tornado_
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location:
Posted: 20th Oct 2003 20:59
thanks, thats a great idea
I dont mind jerky - i just want to make a game!!

so far ive done menu screen, instructions, options and high scores
I just need to make the game

Its not very good without it!
Thanks
super_tornado_
super_tornado_
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location:
Posted: 20th Oct 2003 22:07 Edited at: 20th Oct 2003 22:09
is arrays or 3d better?

i have dbc
Thanks
super_tornado_
super_tornado_
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location:
Posted: 22nd Oct 2003 00:19
?
Darkflame
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location:
Posted: 22nd Oct 2003 14:33
Stick to 2D arrays and sprites.

Once you have the "game" working in the array, you can display it as 2D spirtes, or 3D blocks

"The man who says it cannot be done is generally interrupted by someone doing it." ~ Elbert Hubbard

Login to post a reply

Server time is: 2024-09-21 05:27:53
Your offset time is: 2024-09-21 05:27:53