在控制台上用键盘玩mc,俯视图二维版本。十分精简生草。
↑↓←→
控制玩家朝向或者移动
空格
相当于mc中拿着当前的物体左键
回车
相当于右键,比如放置、吃食物、取决于您手上目前是什么物品
0123456789
相当于切换物品栏上的物品,相当于mc中的鼠标滚轮。
a c
控制可合成的物品列表滚动选择
c
合成物品
编译 game.cpp 即可
C++实现的控制台文字版本Minecraft小游戏
gcc 12.2.0编译出错,报错如下:
In file included from Player.h:10,
from printer.h:10,
from game.cpp:11:
object.h: In function 'bool isEatable(GameObject)':
object.h:218:23: error: 'class std::unordered_map<GameObject, int>' has no member named 'contains'
218 | if (foodTastiness.contains(o)) {
| ^~~~~~~~
Player.h: In member function 'bool Player::digBlock(GameObject)':
Player.h:87:26: error: 'class std::unordered_map<GameObject, int>' has no member named 'contains'
87 | if (ToolDigLevel.contains(tool)) {
| ^~~~~~~~
Player.h: In member function 'void Player::loseObject(GameObject)':
Player.h:121:13: error: 'raise' was not declared in this scope
121 | raise(101);
| ^~~~~
命令:g++ -s game.cpp game.exe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.