• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

Tran Minh Quang

Help me Terris source code

7 posts in this topic

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: tran_minh_quang@hotmail.com Thanks alot. Quang
0

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
0

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
,k=16778240,Q=9,I,x=9,n,y,r,p,i,a,t,u,v,e,s[30][20],P[]={1632,75328,83488,74274,
222272,221728,206368};DDBLTFX b={100};LPDIRECTDRAW d;LPDIRECTDRAWSURFACE V,_;HDC
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()
{for(i=1;i<30;i++){a=1;for(I=0;I<20&&a;a=s[i][I++]);if(a){for(I=i*20+19;I>=20;s[
I/20
][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=
y;TranslateMessage(&g);DispatchMessage(&g);(g.message==275&&Q)?SetTimer(W,1,1050
-50*((e<100)?e/5:20),0),u++:K(38)?v=r?v-1:P[p]>>16&3:K(37)?t--:K(39)?t++:K(40)?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
;I++)if(B(I%4,I/4,r,P[p]))s[y+I/4][x+I%4]=1<<23;y?p=n,y=0,n=rand()%7,x=9,r=0:Q=0
;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,
L,s[I/20][I%20]);for(I=0;I<L;I++){if(B(I%4,I/4,r,P[p]))F((x+I%4)*L,(y+I/4)*L,L,L
,M(p));F(336+I%4*L,400+I/4*L,L,L,B(I%4,I/4,0,P[n])?M(n):0);}_->GetDC(&q);itoa(e,
z,10);SelectObject(q,GetStockObject(13));SetTextColor(q,M(6));SetBkMode(q,0);V->
Restore();TextOut(q,336,120,m+7,L);TextOut(q,336,340,m+24,6);TextOut(q,408,340,z
,strlen(z));TextOut(q,336,380,m+31,5);TextOut(q,444,300,m+37,9-Q);SelectObject(q
,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,
0,0,0,m};RegisterClass(&w);W=CreateWindow(m,m,2432696320,0,0,640,480,0,0,h,0);p=
rand()%7;ShowCursor(0);DirectDrawCreate(0,&d,0);d->SetCooperativeLevel(W,83);d->
SetDisplayMode(640,480,32);d->CreateSurface(&S,&V,0);V->GetAttachedSurface(&c,&_
);n=rand()%7;SetTimer(W,1,0,0);while(g.message!=18)PeekMessage(&g,0,0,0,1)?G():R
();int U=0;V->Release();d->Release();DestroyWindow(W);DeleteObject(f);return U;}



------------------------
0

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
0

Share this post


Link to post
Share on other sites