How to realize simple bouncing Ball in C language
Most people do not understand the knowledge points of this article "how to achieve a simple bouncing ball in C language", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article, let's take a look at this "C language how to achieve a simple bouncing ball" article.
This section uses the printf function to achieve a bouncing ball on the screen, the content is simple and easy to get started, which is what we may use in designing more games in the future.
Draw a stationary ball
We will play the game in the coordinate system as shown in the figure, that is, take the upper left corner of the window as the origin.
We want to display the stationary ball at the coordinates (x, y):
# include int main () {int iJournal j; / / these two quantities are to be used in the loop, so be sure to declare int x = 5; int y = 10; / / output the blank line [x coordinates] for (iS0; I) above the ball