游戏前特效

本文直接展示使用C++实现游戏前特效的代码示例,旨在探讨如何通过编程技术创造吸引人的游戏开场效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

废话不多说,直接上代码

#include<iostream> 
#include<windows.h> 
using namespace std;
void GotoXY(int x, int y)  // 移动 
{
 HANDLE hout;  //屏幕尺寸 变量 
 COORD coord={x,y};  //光标坐标 变量  光标x标  光标y标 
 hout=GetStdHandle(STD_OUTPUT_HANDLE);  //获得屏幕尺寸 
 SetConsoleCursorPosition(hout,coord);  //移动光标 
}
int main()
{
 cout<<0;
 GotoXY(0,1);
 system("pause");
 system("cls");
 int x=0;
 for (int i=1;i<=40;i++)
 {
  GotoXY(x,0);
  cout<<" ";
  x++;
  GotoXY(x,0);
  cout<<0;
  Sleep(15);
 }
 int y=0;
 for (int i=1;i<=15;i++)
 {
  GotoXY(x,y);
  cout<<" ";
  y++;
  GotoXY(x,y);
  cout<<"0";
  Sleep(20);
 }
 GotoXY(x,y+1);
 for (int i=1;i<=6;i++)
 {
  GotoXY(x,y);
  if (i==1)
  {
   cout<<"你"; 
  }
  if (i==2)
  {
   cout<<" ";
  }
  if (i==3)
  {
   cout<<"好";
  }
  else
  {
   cout<<".";
  }
  x++;
  GotoXY(x,y);
  cout<<"0";
  Sleep(20);
 }
 GotoXY(x,y+1);
 system("pause");
 system("cls");
 for (int i=1;i<=6;i++)
 {
  GotoXY(x,y);
  cout<<" ";
  x--;
  GotoXY(x,y);
  cout<<"0";
  Sleep(20);
 }
 Sleep(60);
 for (int i=1;i<=6;i++)
 {
  GotoXY(x,y);
  cout<<" ";
  y--;
  GotoXY(x,y);
  cout<<"0";
  Sleep(25);
 }
 for (int i=1;i<=7;i++)
 {
  GotoXY(x,y);
  cout<<" ";
  x++;
  GotoXY(x,y);
  cout<<0;
  Sleep(15);
 }
 GotoXY(x-5,y);
 cout<<"请";
 Sleep(50); 
 cout<<"写";
 Sleep(50);
 cout<<"出";
 Sleep(50);
 cout<<"姓";
 Sleep(50);
 cout<<"名";
 Sleep(50);
 cout<<":";
 GotoXY(x,y);
 cout<<" ";
 y++;
 GotoXY(x,y);
 cout<<0;
 Sleep(25);
 for (int i=1;i<=7;i++)
 {
  GotoXY(x,y);
  cout<<" ";
  x++;
  GotoXY(x,y);
  cout<<0;
  Sleep(20);
 }
 GotoXY(x,y-1); 
 string name;
 cin>>name;
 Sleep(17);
 GotoXY(x-11,y-1);
 for (int i=1;i<=6;i++)
 {
  cout<<" ";
  Sleep(20);
 }
 for (int i=1;i<=5;i++)
 {
  GotoXY(x,y);
  cout<<" ";
  x--;
  GotoXY(x,y);
  cout<<0;
  Sleep(20);
 }
 for (int i=1;i<=2;i++)
 {
  GotoXY(x,y);
  if (i==2)
  {
   cout<<"您"; 
  }
  else
  {
   cout<<" ";
  }
  y--;
  GotoXY(x,y);
  cout<<0;
  Sleep(25);
 }
 Sleep(600);
 GotoXY(x,y);
 cout<<" ";
 y--;
 GotoXY(x,y);
 cout<<0;
 Sleep(85);
 GotoXY(x,y);
 cout<<" ";
 y++;
 GotoXY(x,y);
 cout<<0;
 Sleep(35);
 GotoXY(x+1,y+1);
 cout<<"好";
 Sleep(65); 
 cout<<",";
 Sleep(65); 
 cout<<" ";
 Sleep(65); 
 GotoXY(x,y+2);
 system("pause");
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值