In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "how to realize air combat games in C language". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
I. Project description and results presentation
Project description: improvements have been made in previous procedures.
For example, multiple bullets can be fired
There can be multiple enemy planes.
Aircraft Wars version 1.0
Aircraft Wars version 2.0
Now this version is version 3.0, and the functions of this version are basically perfect.
The effect picture is as follows:
Second, fire multiple bullets
The code is as follows:
# include#include#include#include#define High 25 / / size of the game # define Width 50 High / Global variable int position_x,position_y;// aircraft location int canvas [High] [Width] = {0} / / two-dimensional array stores the corresponding element / / 0 in the game canvas, space 1, aircraft 2, bullet 3, enemy plane void gotoxy (int xmagin int y) / / move the cursor to the (XMagery y) position {HANDLE handle=GetStdHandle (STD_OUTPUT_HANDLE); COORD pos; pos.X=x; pos.Y=y; SetConsoleCursorPosition (handle,pos);} void startup () / / initialization of data {position_x=High/2; position_y=Width/2 Canvas [position _ x] [position_y] = 1;} void show () / / display screen {int iLING j; gotoxy (0P0); / / move the cursor to the origin position, and redraw the screen for (iDiver0posi) below.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.