Airplane games
The teacher provided the aircraft game code, put the code into the Cfree run, there is a black dialog box, a seemingly simple game, but the code does not seem easy.
Use the arrow keys to control the aircraft moving around, with W control fired bullets, enemy aircraft constantly flew down from above, bullets hit enemy aircraft score, I machine was the opposite plane crashed into my machine died.
Defines a two-bit array-to-bit game interface that reads the data from the keyboard operation array, outputs the entire array, refreshes, repeats.
Enemy movement: Starting from the first element of the array line, if the number of enemy aircraft, the value of moving down one line, the original position is assigned to a blank value.
Bullet movement: From the last line of the array to determine the first element, if it is a bullet value, the value moves down one line, the original position is assigned to a blank value.
Output array: Starting from the first element in the array, judging the array inside, and outputting the corresponding symbol.
[Airplane Game}