





《Paper Minecraft v3.0 - 增强版》玩法指南
🎮 游戏概述
这是一个基于控制台的 2D 版《我的世界》游戏,具有创造模式、多维度探索和丰富的方块系统。游戏采用 ASCII 字符图形,支持完整的世界生成、物品系统和跨维度冒险。
🕹️ 基本操控
游戏内操控(创造模式)
- W/A/S/D - 向上/左/下/右移动
- X - 破坏当前所在的方块
- 空格键 - 放置方块(或使用物品,如打火石)
- 数字键 1-0 - 快速切换快捷栏
- E - 打开物品栏界面
- P - 打开设置菜单
- F5 - 快速保存游戏
- F6 - 快速加载游戏
- ESC - 暂停游戏/返回菜单
菜单导航
- W/S - 上下移动选择项
- 空格键 - 确认选择
- ESC - 返回上一级菜单
- A/D - 在某些设置中切换选项值
- 回车键 - 在输入框确认输入
🌍 游戏功能详解
1. 世界生成与管理
- 新建世界:在主菜单选择"New World",输入世界名称和种子
- 种子可为空(随机生成)或输入特定数字
- 世界名称不能重复
- 加载世界:在主菜单选择"Load World",从已保存的世界中选择
- 世界保存:
- 通过暂停菜单的"Save Game"保存
- 或按 F5 快速保存(仅当世界已有名称)
- 世界类型:
- 主世界(Overworld):蓝色天空,包含草地、树木、矿石等
- 下界(Nether):红色环境,包含熔岩、下界岩、石英矿等
2. 方块系统
游戏包含超过 35 种不同的方块,包括:
- 基础方块:草方块、泥土、石头、木头
- 矿石:煤矿石、铁矿石、金矿石、钻石矿石、红石矿石、绿宝石矿石
- 下界方块:下界岩、灵魂沙、下界砖、石英矿、下界金矿
- 特殊方块:水、熔岩、黑曜石、萤石、蘑菇
- 功能方块:下界传送门、火、打火石
3. 创造模式物品栏系统
游戏只有创造模式,但具有完整的物品管理系统:
- 无限资源:所有方块无限供应
- 物品栏界面(E 键):
- 显示 10 个快捷栏槽位
- 可交换物品位置(用空格键选择后交换)
- 包含"创造模式菜单"选项,可访问所有方块
- 创造模式菜单:
- 浏览所有可用方块
- 选择后自动放入当前选中的快捷栏槽位
4. 下界维度系统
游戏的核心特色:完整的跨维度冒险
- 建造下界传送门:
- 用黑曜石(方块 ID 32)建造 4×5 的框架
- 用打火石(方块 ID 31)点击框架底部激活
- 传送门需要 4×5 的外框,内部 2×3 区域为空
- 跨维度旅行:
- 站在激活的传送门中自动进入另一维度
- 传送门有 2 秒冷却时间
- 两边的传送门会自动生成或激活
- 下界特色:
- 独特的红色环境
- 熔岩海、岩浆块、下界堡垒
- 下界石英矿、下界金矿
- 下界蘑菇、灵魂沙
- 萤石吊灯
5. 工具与互动
- 打火石(方块 ID 31):
- 用于激活传送门
- 也可用于点燃火(点击黑曜石以外的地方)
- 水与熔岩:
- 可像普通方块一样放置
- 不能破坏基岩(方块 ID 7)和传送门方块
6. 游戏设置
通过 P 键或暂停菜单进入设置:
- 帧率调整:5fps、10fps、50fps
- 渲染距离:5、10、15 格
- 游戏保存/加载
- 返回游戏
🗺️ 世界生成特色
主世界:
- 程序化生成的山丘、山谷
- 自然生成的水体
- 随机树木和森林
- 地下矿洞系统
- 基岩层作为世界底部
下界:
- 多层基岩天花板和地板
- 复杂的洞穴系统
- 熔岩海
- 蘑菇森林
- 随机生成的地狱堡垒结构
- 矿脉:石英矿和金矿
📁 存档系统
- 游戏自动创建"saves"文件夹
- 每个世界保存为独立的.dat 文件
- 包含:
- 种子和世界数据
- 玩家位置和状态
- 主世界和下界的所有方块
- 物品栏内容
- 当前所在维度信息
⚙️ 技术特性
- 实时渲染:根据渲染距离动态显示周围环境
- 双世界系统:同时维护主世界和下界的数据
- 防误操作延迟:菜单切换有 1 秒延迟,防止误操作
- 输入缓冲:支持世界名称和种子输入
🎯 游戏目标(创造模式)
虽然创造模式没有明确目标,但可以:
- 建造:创建宏伟的建筑和结构
- 探索:发现两个维度的所有特性
- 工程:建造功能性结构(如下界传送门系统)
- 收集:获得所有类型的方块
💡 实用技巧
- 快速建筑:使用创造模式菜单直接获取任何方块
- 维度标记:在传送门旁建造地标,防止迷路
- 安全第一:在下界小心熔岩海和岩浆块
- 备份存档:重要建筑前先备份世界文件
- 种子分享:记录有趣的种子与朋友分享相同世界
🚨 注意事项
- 游戏不能破坏基岩和传送门方块
- 水在下界会蒸发(游戏中可能不可放置)
- 某些方块(如火)会随时间消失
- 世界名称区分大小写
祝你在《Paper Minecraft v3.0》的方块世界中玩得愉快!有任何问题,可以查看游戏内的"About"部分获取更多信息。
#include<bits/stdc++.h>
#include <conio.h>
#include <windows.h>
#include <time.h>
#include <fstream>
#include <direct.h>
#include <io.h>
#include <sys/stat.h>
#define key(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1 : 0)
using namespace std;
enum GameState { MAIN_MENU, IN_GAME, INVENTORY_MENU, SETTINGS_MENU, NEW_WORLD_MENU, LOAD_WORLD_MENU, NETHER_DIMENSION };
GameState gameState = MAIN_MENU;
string worldName;
bool isCreativeMode = true;
int world[301][601] = {0};
int netherWorld[301][601] = {0};
int grass[601] = {0};
int x = 300, y = 150;
int seed = 0;
int fps = 100, render = 10;
int currentBlock = ;
inventory[] = {};
inventoryCount[] = {};
menuSelection = ;
inventorySelection = ;
worldSelection = ;
vector<string> savedWorlds;
creativeSelection = ;
isSelectingItem = ;
selectedSlot = ;
inNether = ;
worldNameInput[] = ;
seedInput[] = ;
inputPos = ;
DWORD lastStateChangeTime = ;
STATE_CHANGE_DELAY = ;
DWORD lastPortalTime = ;
PORTAL_COOLDOWN = ;
_color( a) {
((STD_OUTPUT_HANDLE), a);
}
{
color;
string appe;
string name;
maxStack = ;
} block[];
{
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].maxStack = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].maxStack = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].maxStack = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].maxStack = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].maxStack = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
block[].appe = ;
block[].color = ;
block[].name = ;
( i = ; i < ; i++) {
inventory[i] = ;
inventoryCount[i] = ;
}
}
{
(id >= && id < && block[id].color >= ) {
_color(block[id].color);
(, block[id].appe.());
} {
_color();
();
}
}
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
{
(x < || x > || y < || y > ) ;
( i = ; i < ; i++) {
(netherWorld[y + i][x] != ) ;
(netherWorld[y + i][x + ] != ) ;
}
( i = ; i < ; i++) {
(netherWorld[y][x + i] != ) ;
(netherWorld[y + ][x + i] != ) ;
}
( i = ; i <= ; i++) {
( j = ; j <= ; j++) {
(netherWorld[y + j][x + i] != && netherWorld[y + j][x + i] != ) ;
}
}
;
}
{
( i = ; i <= ; i++) {
( j = ; j <= ; j++) {
netherWorld[y + j][x + i] = ;
}
}
}
{
(inventory[currentBlock] != ) ;
(!inNether) {
(world[y][x] == ) {
( offsetX = ; offsetX <= ; offsetX++) {
( offsetY = ; offsetY <= ; offsetY++) {
portalX = x + offsetX;
portalY = y + offsetY;
(portalX >= && portalX <= && portalY >= && portalY <= ) {
((portalX, portalY)) {
(portalX, portalY);
_color();
();
();
;
}
}
}
}
world[y][x] = ;
_color();
();
();
}
} {
(netherWorld[y][x] == ) {
( offsetX = ; offsetX <= ; offsetX++) {
( offsetY = ; offsetY <= ; offsetY++) {
portalX = x + offsetX;
portalY = y + offsetY;
(portalX >= && portalX <= && portalY >= && portalY <= ) {
((portalX, portalY)) {
(portalX, portalY);
_color();
();
();
;
}
}
}
}
netherWorld[y][x] = ;
_color();
();
();
}
}
}
{
DWORD currentTime = ();
(currentTime - lastPortalTime < PORTAL_COOLDOWN) {
;
}
(!inNether) {
(world[y][x] == ) {
lastPortalTime = currentTime;
();
}
} {
(netherWorld[y][x] == ) {
lastPortalTime = currentTime;
();
}
}
}
{
(inNether) ;
inNether = ;
gameState = NETHER_DIMENSION;
lastStateChangeTime = ();
_color();
();
();
netherEmpty = ;
( i = ; i <= ; i++) {
( j = ; j <= ; j++) {
(netherWorld[i][j] != && netherWorld[i][j] != ) {
netherEmpty = ;
;
}
}
(!netherEmpty) ;
}
(netherEmpty) {
();
}
portalX = ((x, ), );
portalY = ((y, ), );
(portalX > ) portalX = ;
(portalX < ) portalX = ;
( i = ; i < ; i++) {
netherWorld[portalY + i][portalX] = ;
netherWorld[portalY + i][portalX + ] = ;
}
( i = ; i < ; i++) {
netherWorld[portalY][portalX + i] = ;
netherWorld[portalY + ][portalX + i] = ;
}
( i = ; i <= ; i++) {
( j = ; j <= ; j++) {
netherWorld[portalY + j][portalX + i] = ;
}
}
x = portalX + ;
y = portalY + ;
}
{
(!inNether) ;
inNether = ;
gameState = IN_GAME;
lastStateChangeTime = ();
_color();
();
();
portalX = ((x, ), );
portalY = ((y, ), );
(!(portalX, portalY)) {
( i = ; i < ; i++) {
world[portalY + i][portalX] = ;
world[portalY + i][portalX + ] = ;
}
( i = ; i < ; i++) {
world[portalY][portalX + i] = ;
world[portalY + ][portalX + i] = ;
}
}
(portalX, portalY);
x = portalX + ;
y = portalY + ;
}
{
(netherWorld, , (netherWorld));
( j = ; j <= ; j++) {
netherWorld[][j] = ;
netherWorld[][j] = ;
(j % == ) {
netherWorld[][j] = ;
netherWorld[][j] = ;
}
}
heightMap[];
noise = ;
heightMap[] = + () % ;
( j = ; j <= ; j++) {
change = () % - ;
heightMap[j] = (, (, heightMap[j] + change * (() % + )));
}
( j = ; j < ; j++) {
heightMap[j] = (heightMap[j] + heightMap[j] + heightMap[j]) / ;
}
( j = ; j <= ; j++) {
groundHeight = heightMap[j];
ceilingHeight = groundHeight - + () % ;
( i = ; i <= ; i++) {
(i <= ceilingHeight) {
netherWorld[i][j] = ;
} (i <= groundHeight) {
netherWorld[i][j] = ;
} {
netherWorld[i][j] = ;
}
}
}
lavaSeaLevel = ;
( j = ; j <= ; j++) {
( i = lavaSeaLevel - ; i <= lavaSeaLevel + ; i++) {
(i >= && i <= && netherWorld[i][j] == ) {
netherWorld[i][j] = ;
}
}
}
( cave = ; cave < ; cave++) {
cave_x = () % + ;
cave_y = + () % ;
cave_size = () % + ;
( i = -cave_size; i <= cave_size; i++) {
( jj = -cave_size; jj <= cave_size; jj++) {
(i*i + jj*jj <= cave_size*cave_size) {
nx = cave_x + i;
ny = cave_y + jj;
(nx >= && nx <= && ny >= && ny <= ) {
(netherWorld[ny][nx] == ) {
netherWorld[ny][nx] = ;
}
}
}
}
}
}
( j = ; j <= ; j++) {
( i = ; i <= ; i++) {
(netherWorld[i][j] == && netherWorld[i][j] == ) {
(() % < ) {
glowstoneHeight = () % + ;
( k = ; k < glowstoneHeight; k++) {
(i + k <= && netherWorld[i + k][j] == ) {
netherWorld[i + k][j] = ;
}
}
}
}
}
}
( mushroom = ; mushroom < ; mushroom++) {
mush_x = () % + ;
mush_y = ;
( i = ; i <= ; i++) {
(netherWorld[i][mush_x] == && netherWorld[i][mush_x] == ) {
mush_y = i + ;
;
}
}
(mush_y > && mush_y <= ) {
mush_size = () % + ;
( i = -mush_size; i <= mush_size; i++) {
( jj = -mush_size; jj <= mush_size; jj++) {
(i*i + jj*jj <= mush_size*mush_size) {
nx = mush_x + i;
ny = mush_y + jj;
(nx >= && nx <= && ny >= && ny <= ) {
(netherWorld[ny][nx] == && () % == ) {
netherWorld[ny][nx] = ;
}
}
}
}
}
}
}
( j = ; j <= ; j++) {
( i = ; i <= ; i++) {
(netherWorld[i][j] == ) {
(() % < ) {
netherWorld[i][j] = ;
}
(i > && () % < ) {
netherWorld[i][j] = ;
}
}
}
}
( j = ; j <= ; j++) {
( i = lavaSeaLevel - ; i <= lavaSeaLevel + ; i++) {
(i >= && i <= && netherWorld[i][j] == ) {
(() % < ) {
netherWorld[i][j] = ;
}
}
}
}
quartzCount = ;
( q = ; q < quartzCount; q++) {
qx = () % + ;
qy = + () % ;
(qx >= && qx <= && qy >= && qy <= ) {
(netherWorld[qy][qx] == ) {
netherWorld[qy][qx] = ;
(() % == ) {
veinSize = () % + ;
( dx = -veinSize; dx <= veinSize; dx++) {
( dy = -veinSize; dy <= veinSize; dy++) {
((dx) + (dy) <= veinSize) {
nx = qx + dx;
ny = qy + dy;
(nx >= && nx <= && ny >= && ny <= ) {
(netherWorld[ny][nx] == ) {
netherWorld[ny][nx] = ;
}
}
}
}
}
}
}
}
}
goldCount = ;
( g = ; g < goldCount; g++) {
gx = () % + ;
gy = ;
locationType = () % ;
(locationType == ) {
( i = ; i <= ; i++) {
(netherWorld[i][gx] == && netherWorld[i][gx] == ) {
gy = i;
;
}
}
} (locationType == ) {
( i = ; i <= ; i++) {
(netherWorld[i][gx] == && netherWorld[i][gx] == ) {
gy = i;
;
}
}
} {
gy = lavaSeaLevel - (() % + );
}
(gy > && gy <= && netherWorld[gy][gx] == ) {
netherWorld[gy][gx] = ;
(() % == ) {
veinSize = () % + ;
( dx = -veinSize; dx <= veinSize; dx++) {
( dy = -veinSize; dy <= veinSize; dy++) {
((dx) + (dy) <= veinSize) {
nx = gx + dx;
ny = gy + dy;
(nx >= && nx <= && ny >= && ny <= ) {
(netherWorld[ny][nx] == ) {
netherWorld[ny][nx] = ;
}
}
}
}
}
}
}
}
( structure = ; structure < ; structure++) {
sx = () % + ;
sy = ;
( i = ; i <= ; i++) {
(netherWorld[i][sx] == && netherWorld[i][sx] == ) {
sy = i;
;
}
}
(sy > && sy <= ) {
structureHeight = () % + ;
structureWidth = () % + ;
( i = ; i < structureHeight; i++) {
( jj = -structureWidth/; jj <= structureWidth/; jj++) {
nx = sx + jj;
ny = sy - i;
(nx >= && nx <= && ny >= && ny <= ) {
(i == || i == structureHeight || jj == -structureWidth/ || jj == structureWidth/) {
(() % == ) {
netherWorld[ny][nx] = ;
}
}
}
}
}
}
}
}
{
(x < || x > || y < || y > ) ;
( i = ; i < ; i++) {
(world[y + i][x] != ) ;
(world[y + i][x + ] != ) ;
}
( i = ; i < ; i++) {
(world[y][x + i] != ) ;
(world[y + ][x + i] != ) ;
}
( i = ; i <= ; i++) {
( j = ; j <= ; j++) {
(world[y + j][x + i] != ) ;
}
}
;
}
{
( i = ; i <= ; i++) {
( j = ; j <= ; j++) {
world[y + j][x + i] = ;
}
}
}
{
a = ;
( i = ; i <= x; i++) {
a = ();
}
a;
}
{
height=(x)%;
treesize=+((x)%);
i,j;
(grass[x]*treesize-height>=){
(i=;i<=height;i++){
world[grass[x]-i][x]=;
}
(i=grass[x]*treesize-height;i<grass[x]-height;i++){
(j=x-treesize;j<=x+treesize;j++){
world[i][j]=;
}
}
}
}
{
vector<pair<, >> lowPoints;
( j = ; j < ; j++) {
(grass[j] > grass[j] && grass[j] > grass[j]) {
valleyDepth = (grass[j] - grass[j], grass[j] - grass[j]);
(valleyDepth >= ) {
lowPoints.({j, grass[j]});
}
}
}
(& point : lowPoints) {
startX = point.first;
waterLevel = point.second + ;
leftX = startX;
(leftX > && grass[leftX] <= waterLevel) {
leftX--;
}
rightX = startX;
(rightX < && grass[rightX] <= waterLevel) {
rightX++;
}
waterLevel = (waterLevel, grass[startX] + );
( xx = leftX; xx <= rightX; xx++) {
( yy = waterLevel; yy <= waterLevel + ; yy++) {
(yy <= && world[yy][xx] == ) {
world[yy][xx] = ;
}
}
}
}
}
{
i, j, k;
grass[] = (seed) % + ;
(k = ; k <= ; k++) {
r = (seed + k - ) % ;
(r == ) grass[k] = grass[k - ] + ;
(r == ) grass[k] = grass[k - ] - ;
grass[k] = grass[k - ];
(grass[k] < ) grass[k] = ;
(grass[k] > ) grass[k] = ;
}
(j = ; j <= ; j++) {
(i = ; i < grass[j]; i++) {
world[i][j] = ;
}
world[grass[j]][j] = ;
(i = grass[j] + ; i <= grass[j] + ; i++) {
(i <= ) world[i][j] = ;
}
(i = grass[j] + ; i <= ; i++) {
(i <= ) world[i][j] = ;
}
world[][j] = ;
}
();
( cave = ; cave < ; cave++) {
cave_x = (seed + cave * ) % + ;
cave_y = (seed + cave * ) % + grass[cave_x] + ;
cave_size = (seed + cave * ) % + ;
( i = -cave_size; i <= cave_size; i++) {
( jj = -cave_size; jj <= cave_size; jj++) {
(i*i + jj*jj <= cave_size*cave_size) {
nx = cave_x + i;
ny = cave_y + jj;
(nx >= && nx <= && ny >= && ny <= ) {
(world[ny][nx] == ) world[ny][nx] = ;
}
}
}
}
}
(i = ; i <= ; i++){
((grass[i]) % == ){
(i);
}
}
}
{
_color();
();
( i = ; i < ; i++) {
(i == currentBlock) {
_color();
} {
_color();
}
();
(inventory[i] > && inventoryCount[i] > ) {
(inventory[i]);
_color();
} {
();
_color();
}
();
}
_color();
();
(inventory[currentBlock] > && inventoryCount[currentBlock] > ) {
(inventory[currentBlock]);
_color();
(, block[inventory[currentBlock]].name.());
} {
();
}
}
{
();
lastStateChangeTime = ();
creativeItems[] = {,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,};
itemCount = ;
() {
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
();
;
}
();
_color();
();
_color();
();
( i = ; i < itemCount; i++) {
(i == creativeSelection) {
_color();
} {
_color();
}
(, i);
(creativeItems[i]);
(, block[creativeItems[i]].name.());
(i == creativeSelection) ();
();
}
(() && creativeSelection > ) {
creativeSelection--;
();
}
(() && creativeSelection < itemCount) {
creativeSelection++;
();
}
((VK_SPACE)) {
(currentBlock >= && currentBlock < ) {
inventory[currentBlock] = creativeItems[creativeSelection];
inventoryCount[currentBlock] = ;
;
}
}
((VK_ESCAPE)) {
;
}
();
}
}
{
();
lastStateChangeTime = ();
() {
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
();
;
}
();
_color();
();
_color();
();
( i = ; i < ; i++) {
(i == inventorySelection) {
_color();
} {
_color();
}
(, i);
(inventory[i] > && inventoryCount[i] > ) {
(inventory[i]);
_color(i == inventorySelection ? : );
(, block[inventory[i]].name.());
} {
();
}
(i == currentBlock) ();
(isSelectingItem && selectedSlot == i) ();
();
}
();
(inventorySelection == ) {
_color();
();
_color();
} {
();
}
(() && inventorySelection > ) {
inventorySelection--;
();
}
(() && inventorySelection < ) {
inventorySelection++;
();
}
((VK_SPACE)) {
(inventorySelection == ) {
();
inventorySelection = ;
} {
(!isSelectingItem) {
isSelectingItem = ;
selectedSlot = inventorySelection;
} {
(selectedSlot != inventorySelection) {
(inventory[selectedSlot], inventory[inventorySelection]);
(inventoryCount[selectedSlot], inventoryCount[inventorySelection]);
}
isSelectingItem = ;
selectedSlot = ;
}
}
}
((VK_ESCAPE)) {
isSelectingItem = ;
selectedSlot = ;
;
}
();
}
}
{
(blockId == || blockId == || blockId == || blockId == || blockId == ) ;
( i = ; i < ; i++) {
(inventory[i] == blockId && inventoryCount[i] < ) {
inventoryCount[i]++;
;
}
}
( i = ; i < ; i++) {
(inventory[i] == ) {
inventory[i] = blockId;
inventoryCount[i] = ;
;
}
}
}
{
(inventory[currentBlock] > && inventoryCount[currentBlock] > ) {
(!inNether) {
(world[y][x] == || world[y][x] == || world[y][x] == ) {
world[y][x] = inventory[currentBlock];
}
} {
(netherWorld[y][x] == || netherWorld[y][x] == || netherWorld[y][x] == || netherWorld[y][x] == ) {
netherWorld[y][x] = inventory[currentBlock];
}
}
}
}
{
string path = + filename + ;
buffer;
((path.(), &buffer) == );
}
{
_mkdir();
string path = + worldName + ;
((worldName) && worldName != ) {
_color();
();
();
;
}
;
(!file.()) {
_color();
();
();
;
}
file.((*)&seed, ());
file.((*)&x, ());
file.((*)&y, ());
file.((*)&inNether, ());
file.((*)&isCreativeMode, ());
( i = ; i <= ; i++) {
file.((*)&world[i][], * ());
}
( i = ; i <= ; i++) {
file.((*)&netherWorld[i][], * ());
}
file.((*)inventory, * ());
file.((*)inventoryCount, * ());
file.();
_color();
(, path.());
();
}
{
string path = + filename + ;
(!(filename)) {
_color();
(, path.());
();
;
}
;
(!file.()) {
_color();
();
();
;
}
file.((*)&seed, ());
file.((*)&x, ());
file.((*)&y, ());
file.((*)&inNether, ());
file.((*)&isCreativeMode, ());
( i = ; i <= ; i++) {
file.((*)&world[i][], * ());
}
( i = ; i <= ; i++) {
file.((*)&netherWorld[i][], * ());
}
file.((*)inventory, * ());
file.((*)inventoryCount, * ());
file.();
worldName = filename;
_color();
(, path.());
();
}
{
savedWorlds.();
info;
((, &info) != ) {
_mkdir();
;
}
WIN32_FIND_DATA findFileData;
HANDLE hFind = (, &findFileData);
(hFind != INVALID_HANDLE_VALUE) {
{
string filename = findFileData.cFileName;
filename = filename.(, filename.() - );
savedWorlds.(filename);
} ((hFind, &findFileData) != );
(hFind);
}
}
{
i, j;
(*currentWorld)[] = inNether ? netherWorld : world;
startY = (, y - render);
endY = (, y + render);
startX = (, x - render);
endX = (, x + render);
(i = startY; i <= endY; i++) {
(j = startX; j <= endX; j++) {
(i == y && j == x) {
_color();
();
} {
(inNether && currentWorld[i][j] == ) {
();
} {
(currentWorld[i][j]);
}
}
();
}
}
_color();
(, x, y);
_color();
(, /fps);
_color();
(, render);
(inNether) {
_color();
();
} {
_color();
();
}
_color();
(!worldName.()) {
(, worldName.());
}
();
_color();
();
}
{
op = ;
newfps = fps, newrender = render;
();
lastStateChangeTime = ();
() {
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
();
;
}
();
_color();
();
( i = ; i < ; i++) {
(i == op) {
_color();
} {
_color();
}
(i) {
: ();
(newfps == ) ();
(newfps == ) ();
();
;
: ();
(newrender == ) ();
(newrender == ) ();
();
;
: ();
;
: ();
;
: ();
;
}
();
}
_color();
();
(() && op > ) {
op--;
();
}
(() && op < ) {
op++;
();
}
((VK_SPACE) || ()) {
(op) {
:
(newfps == ) newfps = ;
(newfps == ) newfps = ;
newfps = ;
;
:
(newrender == ) newrender = ;
(newrender == ) newrender = ;
newrender = ;
;
:
();
;
:
gameState = LOAD_WORLD_MENU;
();
;
:
fps = newfps;
render = newrender;
gameState = IN_GAME;
;
}
();
}
(()) {
(op) {
:
(newfps == ) newfps = ;
(newfps == ) newfps = ;
newfps = ;
;
:
(newrender == ) newrender = ;
(newrender == ) newrender = ;
newrender = ;
;
}
();
}
((VK_ESCAPE)) {
gameState = IN_GAME;
;
}
();
}
}
{
menuSelection = ;
();
lastStateChangeTime = ();
(gameState == MAIN_MENU) {
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
();
;
}
();
_color();
();
_color();
();
string menuItems[] = {, , , };
( i = ; i < ; i++) {
(i == menuSelection) {
_color();
(, menuItems[i].());
_color();
} {
_color();
(, menuItems[i].());
}
}
_color();
();
(() && menuSelection > ) {
menuSelection--;
();
}
(() && menuSelection < ) {
menuSelection++;
();
}
((VK_SPACE)) {
(menuSelection) {
:
(worldNameInput, , (worldNameInput));
inputPos = ;
gameState = NEW_WORLD_MENU;
lastStateChangeTime = ();
;
:
gameState = LOAD_WORLD_MENU;
();
lastStateChangeTime = ();
;
:
();
_color();
();
_color();
();
();
();
();
();
();
();
();
();
();
();
();
();
();
_color();
();
(!_kbhit());
_getch();
;
:
();
}
();
}
();
}
}
{
(worldNameInput, , (worldNameInput));
(seedInput, , (seedInput));
currentInput = ;
();
lastStateChangeTime = ();
(gameState == NEW_WORLD_MENU) {
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
();
;
}
();
_color();
();
_color();
(, worldNameInput);
(currentInput == ) ();
();
_color();
(, seedInput);
(currentInput == ) ();
();
_color();
();
();
(_kbhit()) {
ch = _getch();
(ch == || ch == ) {
(currentInput == ) {
((worldNameInput) == ) {
_color();
();
();
;
}
worldName = worldNameInput;
((worldName)) {
_color();
();
();
;
}
currentInput = ;
} (currentInput == ) {
((seedInput) > ) {
seed = (seedInput);
} {
seed = (() + ()) % ;
(seedInput, , seed);
}
();
seed = (seed % );
(seed);
(world, , (world));
(netherWorld, , (netherWorld));
(grass, , (grass));
();
();
();
x = ;
y = grass[] > ? grass[] - : ;
inventory[] = ;
inventoryCount[] = ;
inventory[] = ;
inventoryCount[] = ;
inventory[] = ;
inventoryCount[] = ;
inventory[] = ;
inventoryCount[] = ;
inventory[] = ;
inventoryCount[] = ;
gameState = IN_GAME;
lastStateChangeTime = ();
;
}
} (ch == ) {
(currentInput == && (worldNameInput) > ) {
worldNameInput[(worldNameInput)] = ;
} (currentInput == && (seedInput) > ) {
seedInput[(seedInput)] = ;
}
} (ch == ) {
gameState = MAIN_MENU;
lastStateChangeTime = ();
;
} ((ch)) {
(currentInput == && (worldNameInput) < ) {
len = (worldNameInput);
worldNameInput[len] = ch;
worldNameInput[len] = ;
} (currentInput == && (seedInput) < ) {
((ch) || ch == ) {
len = (seedInput);
seedInput[len] = ch;
seedInput[len] = ;
}
}
}
}
();
}
}
{
worldSelection = ;
();
lastStateChangeTime = ();
(gameState == LOAD_WORLD_MENU) {
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
();
;
}
();
_color();
();
(savedWorlds.()) {
_color();
();
} {
( i = ; i < savedWorlds.(); i++) {
(i == worldSelection) {
_color();
(, savedWorlds[i].());
_color();
} {
(, savedWorlds[i].());
}
}
}
();
(worldSelection == savedWorlds.()) {
_color();
();
_color();
} {
();
}
_color();
();
totalItems = savedWorlds.() + ;
(() && worldSelection > ) {
worldSelection--;
();
}
(() && worldSelection < totalItems - ) {
worldSelection++;
();
}
((VK_SPACE)) {
(worldSelection < savedWorlds.()) {
(savedWorlds[worldSelection]);
gameState = IN_GAME;
lastStateChangeTime = ();
;
} {
gameState = MAIN_MENU;
lastStateChangeTime = ();
;
}
}
((VK_ESCAPE)) {
gameState = MAIN_MENU;
lastStateChangeTime = ();
;
}
();
}
}
{
();
();
(());
();
() {
(gameState) {
MAIN_MENU:
();
;
NEW_WORLD_MENU:
();
;
LOAD_WORLD_MENU:
();
;
IN_GAME:
NETHER_DIMENSION:
();
(() - lastStateChangeTime < STATE_CHANGE_DELAY) {
(fps);
();
;
}
(()) y--;
(()) y++;
(()) x--;
(()) x++;
(x > ) x = ;
(x < ) x = ;
(y > ) y = ;
(y < ) y = ;
( i = ; i < ; i++) {
(( + i)) {
currentBlock = i;
}
}
(()) {
destroyedBlock;
(!inNether) {
destroyedBlock = world[y][x];
(destroyedBlock != && destroyedBlock != && destroyedBlock != && destroyedBlock != ) {
world[y][x] = ;
(destroyedBlock);
}
} {
destroyedBlock = netherWorld[y][x];
(destroyedBlock != && destroyedBlock != && destroyedBlock != && destroyedBlock != && destroyedBlock != ) {
netherWorld[y][x] = ;
(destroyedBlock);
}
}
}
((VK_SPACE)) {
(inventory[currentBlock] == ) {
(x, y);
} {
();
}
}
();
(()) {
();
}
(()) {
();
}
((VK_F5)) {
(!worldName.()) {
();
}
}
((VK_F6)) {
(()) {
();
}
}
((VK_ESCAPE)) {
pauseSelection = ;
DWORD pauseStartTime = ();
() {
(() - pauseStartTime < ) {
();
;
}
();
_color();
();
string pauseItems[] = {, , , , };
( i = ; i < ; i++) {
(i == pauseSelection) {
_color();
(, pauseItems[i].());
_color();
} {
(, pauseItems[i].());
}
}
_color();
();
(() && pauseSelection > ) {
pauseSelection--;
();
}
(() && pauseSelection < ) {
pauseSelection++;
();
}
((VK_SPACE)) {
(pauseSelection) {
:
;
:
();
;
:
gameState = LOAD_WORLD_MENU;
();
lastStateChangeTime = ();
;
:
();
;
:
gameState = MAIN_MENU;
lastStateChangeTime = ();
;
}
;
}
((VK_ESCAPE)) {
;
}
();
}
}
(fps);
();
;
}
}
;
}