Lu Meng 3035639379
Chen Xueqing 3035638351
- For Windows
- Go to
switch.h
- Undefine
LINUX
- Compile using
g++ -pedantic-errors -std=c++11 welcome.cpp keyboard.cpp menu.cpp main.cpp -o main.exe
- Run
main.exe
- Go to
- For Linux
- Go to
switch.h
- Define
LINUX
- Use command
make main
Alternatively, compile usingg++ -pedantic-errors -std=c++11 welcome.cpp keyboard.cpp menu.cpp main.cpp -o main -lpthread
- Run
main
- Go to
- For Mac OS
- Oops! We don't support that.
- Caution! This is a real-time game. It performs better when running locally.
The game is a word-guessing game with a countdown.
At first, the player will get an incomplete word with only part of its letters displayed, other hidden letters will be displayed as short dashes. The player needs to use a basket to catch letters falling from the top of the screen within a given time.
If he/she catches the right letter, the letter will be revealed by replacing the corresponding dash. If he/she catches the wrong letter, the left time will be reduced.
If the player fills the word within the given time, he/she can challenge the next level, and the left time will be added to the countdown of the next level.
If time runs out before the word is filled, the game is over directly.
After the game, the player will be credited to the leaderboard. The player who passes more levels with more time left will get a higher ranking.
- Include macro definitions and function declarations stored in *.h 5.Program codes in multiple files
- Output the greeting words and the menu to the screen
- Get the commands of the player as input
- Initialize all kinds of data
- Initialize the basket which is controlled by the player
- Initialize the letters falling from the top of the screen 2.Data structures for storing game status
- Initialize the hidden words for this level 1.Generation of random game sets or events
- Initialize the countdown for this level
- Move the basket according to the player's operation
- Judge whether the player has caught the right letter
- Update the letters falling from the top of the screen 3.Dynamic memory management
- Update the word by revealing the hidden letter if the player has caught the right one
- Show the passage of time
- Display all updated data
- Judge whether the player has passes the game
- Record the performance of the player 4.File input/output
#include <windows.h>
#include <conio.h>
Implement reading keyboard for Windows#include <termios.h>
#include <unistd.h>
Implement reading keyboard for Linux