c언어를 사용한 테트리스 게임입니다.
- 최초 등록일
- 2011.07.28
- 최종 저작일
- 2009.10
- 20페이지/
한컴오피스
- 가격 1,500원
![할인쿠폰받기](/images/v4/document/ico_det_coupon.gif)
소개글
c언어를 사용하여 만든 테트리스 게임입니다.
블럭 모양은 5가지 입니다.
목차
없음
본문내용
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
// definitions
#define NUM_ROW 22
#define NUM_COL 11
#define KEY_LEFTMOVE `4`
#define KEY_RIGHTMOVE `6`
#define KEY_ROTATE `5`
#define KEY_SPEEDUP `2`
//shape definitions
//
//SHAPE_BAR SHAPE_BOX SHAPE_S SHAPE_REVERSE_S SHAPE_L
//
// # ## # # #
// # ## ## ## ##
// # # # #
// #
#define SHAPE_BAR 10 // bar type
#define SHAPE_BAR1 11 // bar rotated 90 degree
#define SHAPE_Z 20
#define SHAPE_Z1 21
//#define SHAPE_BOX 20 // box type
#define SHAPE_S 30
#define SHAPE_S1 31 // S rotated 90 degree
#define SHAPE_S2 40
#define SHAPE_S3 41 // reverse S rotated b 90 degree
//#define SHAPE_L 50 // L shaped
#define SHAPE_L1 51 // L shaped rotated by 90 degree
//#define SHAPE_L2 52 // L shaped rotated by 180 degree
//#define SHAPE_L3 53 // L shaped rotated by 270 degree
#define SHAPE_B 60
#define SHAPE_B1 61
#define SHAPE_B2 62
#define SHAPE_B3 63
#define SHAPE_T 70
#define SHAPE_T1 71
#define SHAPE_T2 72
#define SHAPE_T3 73
#define SHAPE_U 80
#define SHAPE_U1 81
#define SHAPE_U2 82
#define SHAPE_U3 83
#define SHAPE_Y 90
#define SHAPE_Y1 91
#define SHAPE_Y2 93
#define SHAPE_Y3 94
// global variables, full screen and scores
char table[NUM_ROW][NUM_COL];
int block=SHAPE_BAR, level=0, point=0, tm=0;
// global variables : a shape and a new shape
char x1,x2,x3,x4,x5;
char y1,y2,y3,y4,y5;
char nx1,nx2,nx3,nx4,nx5;
char ny1,ny2,ny3,ny4,ny5;
// function prototypes
void new_block();
void move();
void scan();
void draw();
int check();
void main()
참고 자료
없음