最近上课在学一个俄罗斯方块小游戏,目标效果是这样
但是我用VS敲出来的效果是这样
方块的间隔很大,尝试了很多办法都不行,符号是正确的。
希望得到各位网友的回复,万分感谢!
源代码呢
请提供更详细的信息
以下是在学校机房实现第一张图片的代码,但是在自己的电脑上却不可以
#include <stdio.h> /头文件/
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
#include <time.h>
#define FrameX 13
#define FrameY 3
#define Frame_height 20//游戏窗口的高度为20//
#define Frame_width 18//游戏窗口的宽度为18//
HANDLE hOut;//控制台句柄//
/**
文字颜色
/
int color(int c)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),c);
return 0;
}
/
获取屏幕光标位置
/
void gotoxy(int x,int y)
{
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
/
*欢迎界面上方标题
*/
void title()
{
color(15);
gotoxy(24,3);
printf("趣 味 俄 罗 斯 方 块\n");
color(11);
gotoxy(18,5);
printf("■");
gotoxy(18,6);
printf("■■");
gotoxy(18,7);
printf("■");
color(14);
gotoxy(26,6);
printf("■■");
gotoxy(28,7);
printf("■■");
color(10);
gotoxy(36,6);
printf("■■");
gotoxy(36,7);
printf("■■");
color(13);
gotoxy(45,5);
printf("■");
gotoxy(45,6);
printf("■");
gotoxy(45,7);
printf("■");
gotoxy(45,8);
printf("■");
color(12);
gotoxy(56,6);
printf("■");
gotoxy(52,7);
printf("■■■");
}
/**
*主函数
*/
int main()
{
title();
}