游戏前特效

拼搏现实的明天。 2023-01-07 10:20 242阅读 0赞

废话不多说,直接上代码

  1. #include<iostream>
  2. #include<windows.h>
  3. using namespace std;
  4. void GotoXY(int x, int y) // 移动
  5. {
  6. HANDLE hout; //屏幕尺寸 变量
  7. COORD coord={ x,y}; //光标坐标 变量 光标x标 光标y标
  8. hout=GetStdHandle(STD_OUTPUT_HANDLE); //获得屏幕尺寸
  9. SetConsoleCursorPosition(hout,coord); //移动光标
  10. }
  11. int main()
  12. {
  13. cout<<0;
  14. GotoXY(0,1);
  15. system("pause");
  16. system("cls");
  17. int x=0;
  18. for (int i=1;i<=40;i++)
  19. {
  20. GotoXY(x,0);
  21. cout<<" ";
  22. x++;
  23. GotoXY(x,0);
  24. cout<<0;
  25. Sleep(15);
  26. }
  27. int y=0;
  28. for (int i=1;i<=15;i++)
  29. {
  30. GotoXY(x,y);
  31. cout<<" ";
  32. y++;
  33. GotoXY(x,y);
  34. cout<<"0";
  35. Sleep(20);
  36. }
  37. GotoXY(x,y+1);
  38. for (int i=1;i<=6;i++)
  39. {
  40. GotoXY(x,y);
  41. if (i==1)
  42. {
  43. cout<<"你";
  44. }
  45. if (i==2)
  46. {
  47. cout<<" ";
  48. }
  49. if (i==3)
  50. {
  51. cout<<"好";
  52. }
  53. else
  54. {
  55. cout<<".";
  56. }
  57. x++;
  58. GotoXY(x,y);
  59. cout<<"0";
  60. Sleep(20);
  61. }
  62. GotoXY(x,y+1);
  63. system("pause");
  64. system("cls");
  65. for (int i=1;i<=6;i++)
  66. {
  67. GotoXY(x,y);
  68. cout<<" ";
  69. x--;
  70. GotoXY(x,y);
  71. cout<<"0";
  72. Sleep(20);
  73. }
  74. Sleep(60);
  75. for (int i=1;i<=6;i++)
  76. {
  77. GotoXY(x,y);
  78. cout<<" ";
  79. y--;
  80. GotoXY(x,y);
  81. cout<<"0";
  82. Sleep(25);
  83. }
  84. for (int i=1;i<=7;i++)
  85. {
  86. GotoXY(x,y);
  87. cout<<" ";
  88. x++;
  89. GotoXY(x,y);
  90. cout<<0;
  91. Sleep(15);
  92. }
  93. GotoXY(x-5,y);
  94. cout<<"请";
  95. Sleep(50);
  96. cout<<"写";
  97. Sleep(50);
  98. cout<<"出";
  99. Sleep(50);
  100. cout<<"姓";
  101. Sleep(50);
  102. cout<<"名";
  103. Sleep(50);
  104. cout<<":";
  105. GotoXY(x,y);
  106. cout<<" ";
  107. y++;
  108. GotoXY(x,y);
  109. cout<<0;
  110. Sleep(25);
  111. for (int i=1;i<=7;i++)
  112. {
  113. GotoXY(x,y);
  114. cout<<" ";
  115. x++;
  116. GotoXY(x,y);
  117. cout<<0;
  118. Sleep(20);
  119. }
  120. GotoXY(x,y-1);
  121. string name;
  122. cin>>name;
  123. Sleep(17);
  124. GotoXY(x-11,y-1);
  125. for (int i=1;i<=6;i++)
  126. {
  127. cout<<" ";
  128. Sleep(20);
  129. }
  130. for (int i=1;i<=5;i++)
  131. {
  132. GotoXY(x,y);
  133. cout<<" ";
  134. x--;
  135. GotoXY(x,y);
  136. cout<<0;
  137. Sleep(20);
  138. }
  139. for (int i=1;i<=2;i++)
  140. {
  141. GotoXY(x,y);
  142. if (i==2)
  143. {
  144. cout<<"您";
  145. }
  146. else
  147. {
  148. cout<<" ";
  149. }
  150. y--;
  151. GotoXY(x,y);
  152. cout<<0;
  153. Sleep(25);
  154. }
  155. Sleep(600);
  156. GotoXY(x,y);
  157. cout<<" ";
  158. y--;
  159. GotoXY(x,y);
  160. cout<<0;
  161. Sleep(85);
  162. GotoXY(x,y);
  163. cout<<" ";
  164. y++;
  165. GotoXY(x,y);
  166. cout<<0;
  167. Sleep(35);
  168. GotoXY(x+1,y+1);
  169. cout<<"好";
  170. Sleep(65);
  171. cout<<",";
  172. Sleep(65);
  173. cout<<" ";
  174. Sleep(65);
  175. GotoXY(x,y+2);
  176. system("pause");
  177. }

发表评论

表情:
评论列表 (有 0 条评论,242人围观)

还没有评论,来说两句吧...

相关阅读

    相关 游戏开发入门(七)特效系统

    视频链接:[游戏开发入门(七)特效系统][Link 1](6节课 时常:约2小时20分钟) 该视频课程与其他本系列的课程不太一样,因为在很多游戏或者很多引擎中并没有一个专门的