- A SNAKE game written in c++ for fun:)
- This is a simple SNAKE game. You will start from the center with the snake head - "0". Then if you successfully get one fruit - "*", your tail - "o" will add one following the head. Next, if you get one fruit again, your new one tail will be added from the end. (What is a SNAKE game?)
- Rule:
- Control key:
- UP : i/I
- DOWN : k/K
- LEFT : j/J
- RIGHT: l/L
- Start: press any key mentioned above
- Exit: press q/Q/e/E
- Gameover: The head hits your tails.
- Control key:
- You can directly download/run this executable program.
- Brief exaplanation about the codes
- Header: There are four basic functions to make this game run. They are
Setup()
for initializarion,Draw()
for printing the "wall", "fruit" and "snake",Input()
for inputting control commands, andLogic()
for judgments on movings and scores in the.H
file. And another onerenew()
just does for updating the position of fruits. - Source: In the
.cpp
file, first it needs to setup and then goes into awhile
loop implementing other three basic functions in it. For a comfortable display, it includes aLinux
'ssleep()
following theDraw()
. This is a testing file to some extent.
- Header: There are four basic functions to make this game run. They are
- Makefile
- Just simply apply:
$ make
- in the command line then it will generate
.o
files and the executable program.
- code references
-
Notifications
You must be signed in to change notification settings - Fork 0
xhf-F/SNAKE
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A SNAKE game written with c++
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published