Advertisement Jump to content


This topic is now archived and is closed to further replies.

Tran Minh Quang

Help me Terris source code

This topic is 6239 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need Terris source code written in Visual C++ 6.0 (with clear description both: algorithms and code, I am new to C++!). If someone has please send me to email: Thanks alot. Quang

Share this post

Link to post
Share on other sites
no, you need to learn c++ first and write some projects on your own. then after you understand how to code and ask specific questions on trouble you are having you will get some better help. dont expct ppl to give up hard work they done, just so you have completed source (with clear comments explaining everything no less). its ppl like you that give some programmers bad names. taking source code and making a few changes then calling it a game you made instead of crediting the original author if the code.

also if you just want the source code written in visual c++ 6.0 and dont care about the language its using, then i may be able to help you

Edited by - a person on December 17, 2001 1:26:22 PM

Share this post

Link to post
Share on other sites
Okay, Tetris source code, written in Visual C++
(compile it and run if you don''t believe me. You need to link ddraw.lib and winmm.lib to it to compile)

/* Super-compressed Tetris. Copyright 2001 Pouya Larjani. Please don''t remove.*/
#include < ddraw.h >

#define B(x,y,r,p) (p&1<<(((x^(r+1&2?3:0))<<(r*2&2))+((y^(r&2?3:0))*(r&1?1:4))))

#define F(x,y,w,h,c) {RECT R={x,y,x+w,y+h};b.dwFillColor=c;_->Blt(&R,0,0,k,&b);}

char *m="Tetris\0By Pouya Larjani\0Score:\0Next:\0GAME OVER",z[9]; unsigned L=16
q;HWND W;LOGFONT l={96,48};MSG g;DDSURFACEDESC S={108,33,0,0,0,1,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,{536}};HFONT f=CreateFontIndirect(&l);DDSCAPS c={4};X()
][I%20]=s[I/20-1][I--%20]);e++;return 1;}}return 0;}M(int p){return(++p<<21&
1<<23|p<<14&1<<15|p<<7&1<<7)+8355711;}K(int v){return GetAsyncKeyState(v)&32768;
}O(int x,int y,int r,int p){for(I=0;I<L;I++)if(B(I%4,I/4,r,P[p])&&(x+I%4<0||x+I%
4>19||y+I/4<0||y+I/4>29||s[y+I/4][x+I%4]))return 0;return 1;}void G(){v=r;t=x;u=
++:K(27)?PostQuitMessage(0):0;if(O(t,u,v,p))x=t,y=u,r=v;else if(u-y){for(I=0;I<L
;while(X());}}void R(){F(0,0,640,480,1<<15);for(I=0;I<600;I++)F(I%20*L,I/20*L,L,
,f);TextOut(q,336,20,m,6);_->ReleaseDC(q);V->Flip(0,1);}WINAPI WinMain(HINSTANCE
h,HINSTANCE,char*,int){srand(timeGetTime());WNDCLASS w={0,DefWindowProc,0,0,h,0,
();int U=0;V->Release();d->Release();DestroyWindow(W);DeleteObject(f);return U;}


Share this post

Link to post
Share on other sites
Well, Tetris has got to be one of the easiest games to make (besides Pong and Guess the Magic Number). You really need to do it yourself. I could make a Tetris source in under an hour (assuming I had the graphics and stuff already made up).

That compressed Tetris thing is really cool lookin' .

Tran Minh Quang you need to not steal other people's source code and calling it your own ESPECIALLY if it is for a school assignment since that is PLAIGARISM, and you could very easily get kicked out of school for that. Sit down for 30 minutes and write out some pseudo-code or draw out plan. Then, write it. It can't take you much longer than 3 hours at the very maximum. Tetris is almost a 200-300 line code (unless you use OpenGL or something then make it about 1000-1300 more for internet play or advanced effects and stuff). The actual game code is less than 100; it's really not that hard.

So, DON'T steal peoples code and call it your own. I really dislike people that take NeHe's code and build it then say THEY made it; they need to give credit where credit is due (i.e. NeHe).

Good luck!

Edited by - Floppy on December 17, 2001 5:35:12 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!