MorriCraft v2.2.7: Physics, UI, Chat, and Asset Polish
|
|
@ -106,7 +106,12 @@ A pre-built `MorriCraft-Windows.zip` is available in the repository root.
|
||||||
|
|
||||||
## 📜 Version History
|
## 📜 Version History
|
||||||
|
|
||||||
### v2.2.6 - Physics & World Management (Current)
|
### v2.2.7 - Performance & Assets (Current)
|
||||||
|
- **Lag Fix**: Reverted render distance to 4 and optimized frustum culling to restore high FPS.
|
||||||
|
- **New Icons**: Added high-quality textures for the Wooden Shovel, Pickaxe, Sword, and Hoe.
|
||||||
|
- **Physics**: Refined anti-stuck resolution for smoother jumping and landing.
|
||||||
|
|
||||||
|
### v2.2.6 - World Management
|
||||||
- **7:00 AM Spawn**: New worlds now start in the morning for immediate daylight.
|
- **7:00 AM Spawn**: New worlds now start in the morning for immediate daylight.
|
||||||
- **Naming System**: Cleaner sequential naming (`World`, `World 1`, `World 2`) instead of nested parentheses.
|
- **Naming System**: Cleaner sequential naming (`World`, `World 1`, `World 2`) instead of nested parentheses.
|
||||||
- **Anti-Stuck Physics**: Active collision resolution pushes players out of blocks if they overlap.
|
- **Anti-Stuck Physics**: Active collision resolution pushes players out of blocks if they overlap.
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 316 KiB |
|
After Width: | Height: | Size: 260 KiB |
|
After Width: | Height: | Size: 303 KiB |
|
|
@ -1 +1 @@
|
||||||
v2.2.6
|
v2.2.7
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 316 KiB |
|
After Width: | Height: | Size: 260 KiB |
|
After Width: | Height: | Size: 303 KiB |
|
|
@ -1 +1 @@
|
||||||
v2.2.6
|
v2.2.7
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 316 KiB |
|
After Width: | Height: | Size: 260 KiB |
|
After Width: | Height: | Size: 303 KiB |
38
src/main.cpp
|
|
@ -636,8 +636,8 @@ void GenerateChunk(int cx, int cz) {
|
||||||
|
|
||||||
bool CheckPlayerCollision(Vector3 pos) {
|
bool CheckPlayerCollision(Vector3 pos) {
|
||||||
BoundingBox playerBox = {
|
BoundingBox playerBox = {
|
||||||
(Vector3){ pos.x - 0.26f, pos.y - 1.45f, pos.z - 0.26f },
|
(Vector3){ pos.x - 0.25f, pos.y - 1.45f, pos.z - 0.25f },
|
||||||
(Vector3){ pos.x + 0.26f, pos.y + 0.05f, pos.z + 0.26f }
|
(Vector3){ pos.x + 0.25f, pos.y + 0.05f, pos.z + 0.25f }
|
||||||
};
|
};
|
||||||
|
|
||||||
int minX = (int)floorf(playerBox.min.x + 0.5f);
|
int minX = (int)floorf(playerBox.min.x + 0.5f);
|
||||||
|
|
@ -899,7 +899,7 @@ int main(void)
|
||||||
// By default, windows have minimize, maximize, and close buttons on the top bar.
|
// By default, windows have minimize, maximize, and close buttons on the top bar.
|
||||||
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT);
|
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT);
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "MorriCraft v2.2.6");
|
InitWindow(screenWidth, screenHeight, "MorriCraft v2.2.7");
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
SetExitKey(KEY_NULL); // Prevent ESC from closing the window
|
SetExitKey(KEY_NULL); // Prevent ESC from closing the window
|
||||||
|
|
||||||
|
|
@ -1047,6 +1047,10 @@ int main(void)
|
||||||
|
|
||||||
blockTextures[STICK] = LoadTexture("assets/stick.png");
|
blockTextures[STICK] = LoadTexture("assets/stick.png");
|
||||||
blockTextures[WOOD_AXE] = LoadTexture("assets/wooden_axe.png");
|
blockTextures[WOOD_AXE] = LoadTexture("assets/wooden_axe.png");
|
||||||
|
blockTextures[WOOD_PICKAXE] = LoadTexture("assets/wooden_pickaxe.png");
|
||||||
|
blockTextures[WOOD_SWORD] = LoadTexture("assets/wooden_sword.png");
|
||||||
|
blockTextures[WOOD_SHOVEL] = LoadTexture("assets/wooden_shovel.png");
|
||||||
|
blockTextures[WOOD_HOE] = LoadTexture("assets/wooden_hoe.png");
|
||||||
|
|
||||||
// Explicitly check for successful load and print warning if fail
|
// Explicitly check for successful load and print warning if fail
|
||||||
if (blockTextures[STICK].id == 0) TraceLog(LOG_WARNING, "FAILED TO LOAD STICK TEXTURE");
|
if (blockTextures[STICK].id == 0) TraceLog(LOG_WARNING, "FAILED TO LOAD STICK TEXTURE");
|
||||||
|
|
@ -1629,7 +1633,12 @@ int main(void)
|
||||||
|
|
||||||
// Handle chat input
|
// Handle chat input
|
||||||
if (IsKeyPressed(KEY_ENTER)) {
|
if (IsKeyPressed(KEY_ENTER)) {
|
||||||
if (isChatting) {
|
if (!isChatting) {
|
||||||
|
isChatting = true;
|
||||||
|
chatInput[0] = '\0';
|
||||||
|
while (GetCharPressed() != 0); // Clear buffer
|
||||||
|
EnableCursor();
|
||||||
|
} else {
|
||||||
if (strlen(chatInput) > 0) {
|
if (strlen(chatInput) > 0) {
|
||||||
if (chatInput[0] == '/') {
|
if (chatInput[0] == '/') {
|
||||||
// Command processing - never sent to network
|
// Command processing - never sent to network
|
||||||
|
|
@ -1675,9 +1684,6 @@ int main(void)
|
||||||
}
|
}
|
||||||
isChatting = false;
|
isChatting = false;
|
||||||
DisableCursor();
|
DisableCursor();
|
||||||
} else {
|
|
||||||
isChatting = true;
|
|
||||||
EnableCursor();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1784,9 +1790,11 @@ int main(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve any lingering overlap to prevent getting stuck
|
// Resolve any lingering overlap to prevent getting stuck (Iterative push-out)
|
||||||
if (!isFlying && CheckPlayerCollision(camera3D.position)) {
|
if (!isFlying) {
|
||||||
camera3D.position.y += 0.05f;
|
for (int i = 0; i < 5 && CheckPlayerCollision(camera3D.position); i++) {
|
||||||
|
camera3D.position.y += 0.05f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Final Camera state
|
// Final Camera state
|
||||||
|
|
@ -2329,8 +2337,8 @@ int main(void)
|
||||||
DrawTexturePro(titleTexture, sourceRec, destRec, origin, 0.0f, WHITE);
|
DrawTexturePro(titleTexture, sourceRec, destRec, origin, 0.0f, WHITE);
|
||||||
EndMode2D();
|
EndMode2D();
|
||||||
|
|
||||||
// Show Version Number (v2.2.6) in Red
|
// Show Version Number (v2.2.7) in Red
|
||||||
DrawTextEx(customFont, "v2.2.6", (Vector2){ (float)currentWidth - 140, (float)currentHeight - 40 }, 22, 1.0f, RED);
|
DrawTextEx(customFont, "v2.2.7", (Vector2){ (float)currentWidth - 140, (float)currentHeight - 40 }, 22, 1.0f, RED);
|
||||||
|
|
||||||
// --- PLAYER NAME POPUP (IF MISSING) ---
|
// --- PLAYER NAME POPUP (IF MISSING) ---
|
||||||
if (playerName == "") {
|
if (playerName == "") {
|
||||||
|
|
@ -2888,7 +2896,7 @@ int main(void)
|
||||||
Vector3 chunkCenter = { (float)(cx * CHUNK_SIZE + 8), 32.0f, (float)(cz * CHUNK_SIZE + 8) };
|
Vector3 chunkCenter = { (float)(cx * CHUNK_SIZE + 8), 32.0f, (float)(cz * CHUNK_SIZE + 8) };
|
||||||
Vector3 toChunk = Vector3Normalize(Vector3Subtract(chunkCenter, camera3D.position));
|
Vector3 toChunk = Vector3Normalize(Vector3Subtract(chunkCenter, camera3D.position));
|
||||||
if (Vector3Length(Vector3Subtract(chunkCenter, camera3D.position)) > 24.0f &&
|
if (Vector3Length(Vector3Subtract(chunkCenter, camera3D.position)) > 24.0f &&
|
||||||
Vector3DotProduct(toChunk, camForward) < -0.2f) continue;
|
Vector3DotProduct(toChunk, camForward) < -0.3f) continue;
|
||||||
|
|
||||||
auto it = worldChunks.find({cx, cz});
|
auto it = worldChunks.find({cx, cz});
|
||||||
if (it == worldChunks.end()) continue;
|
if (it == worldChunks.end()) continue;
|
||||||
|
|
@ -3305,7 +3313,7 @@ int main(void)
|
||||||
// Close hint
|
// Close hint
|
||||||
DrawTextEx(customFont, "Press E or ESC to close", (Vector2){ (float)(invPanelX + 12), (float)(invPanelY + invPanelH - 22) }, 14, 1.0f, (Color){160, 160, 160, 200});
|
DrawTextEx(customFont, "Press E or ESC to close", (Vector2){ (float)(invPanelX + 12), (float)(invPanelY + invPanelH - 22) }, 14, 1.0f, (Color){160, 160, 160, 200});
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_ESCAPE)) {
|
if (IsKeyPressed(KEY_ESCAPE) || IsKeyPressed(KEY_E)) {
|
||||||
inventoryOpen = false;
|
inventoryOpen = false;
|
||||||
DisableCursor();
|
DisableCursor();
|
||||||
}
|
}
|
||||||
|
|
@ -3335,7 +3343,7 @@ int main(void)
|
||||||
|
|
||||||
drawInvGrid(guiX + 16, tableStartY + 3*(invSlotSize+invGap) + 40);
|
drawInvGrid(guiX + 16, tableStartY + 3*(invSlotSize+invGap) + 40);
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_ESCAPE)) {
|
if (IsKeyPressed(KEY_ESCAPE) || IsKeyPressed(KEY_E)) {
|
||||||
currentState = GAMEPLAY;
|
currentState = GAMEPLAY;
|
||||||
DisableCursor();
|
DisableCursor();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
v2.2.6
|
v2.2.7
|
||||||
|
|
|
||||||