1 Star 0 Fork 0

jeefy / gluttonous snake

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Unlicense

Gluttonous Snake Game

A simple game made by SDL(simple directmedia layer)
But here achieve it by three ways: c, c++, and golang

Notice

The Full game see the codes under cpp
c and go just made the main functions such as moving the snake and eating the food to grow length
But cpp version made extra achievements like counting the score and showing the state

Build

C C++

make sure you have install SDL on your computer and you can use it with pkg-config
Also, all the version need SDL_ttf, make sure it's installed, too.
Then, use make to compile c and cpp versions.
Notice: The default compiler is gcc, you can download mingw to compile this

Golang

This is special to build
for some reason, it still use make.

Copy Libraries

make four new directory (pkg, bin, include and lib) under go folder.
get to the path you install the sdl and copy the .so (on Linux/Unix) or .dll(Windows) or even .dylib(MacOS) files under lib folder to the lib folder you have made.
Rename SDL2 to SDLg (all c-share library)

Copy Headers

copy all files under include folder to include folder you have made.
Remember to rename SDL.h to SDLg.h

to build

Make sure you can use go compiler.
Download go on GoLang or Org Site
use makefile to build everything (Do not mind command echo not found!)

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org>

简介

用c,c++,golang实现贪吃蛇 完整程序参考c++版本 More detail see README file 展开 收起
Unlicense
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/jeefy/snake.git
git@gitee.com:jeefy/snake.git
jeefy
snake
gluttonous snake
master

搜索帮助