if (wallTexture) { // Base color components for #9e9a56 int baseR = 158; // 0x9e int…
- User
if (wallTexture) { // Base color components for #9e9a56 int baseR = 158; // 0x9e int baseG = 154; // 0x9a int baseB = 86; // 0x56
// Adjust color intensity based on distance float distanceFactor = (float)Math.Clamp(1.0 / (perpWallDist * 1.5), 0.0, 1.0); int colorR = (int)(baseR * distanceFactor); int colorG = (int)(baseG * distanceFactor); int colorB = (int)(baseB * distanceFactor); string baseWallColor = $"\u001b[38;2;{colorR};{colorG};{colorB}m"; string darkWallColor = $"\u001b[38;2;{Math.Max(colorR - 30, 0)};{Math.Max(colorG - 30, 0)};{Math.Max(colorB - 30, 0)}m"; // Darken colors for y-sides to add depth if (side == 1) { colorR = Math.Max(colorR - 30, 0); colorG = Math.Max(colorG - 30, 0); colorB = Math.Max(colorB - 30, 0); baseWallColor = $"\u001b[38;2;{colorR};{colorG};{colorB}m"; darkWallColor = $"\u001b[38;2;{Math.Max(colorR - 20, 0)};{Math.Max(colorG - 20, 0)};{Math.Max(colorB - 20, 0)}m"; } for (int y = drawStart; y <= drawEnd; y++) { if (y >= 0 && y < screenHeight && x >= 0 && x < screenWidth) { // Create a simple pattern bool isAlternateColor = ((y + x) % 2 == 0); // Set wall color and pattern colorBuffer[y, x] = isAlternateColor ? darkWallColor : baseWallColor; screenBuffer[y, x] = isAlternateColor ? '█' : '█'; // Different characters for texture } }} else { // Base color components for #9e9a56 int baseR = 158; // 0x9e int baseG = 154; // 0x9a int baseB = 86; // 0x56
// Adjust color intensity based on distance float distanceFactor = (float)Math.Clamp(1.0 / (perpWallDist * 1.5), 0.0, 1.0); int colorR = (int)(baseR * distanceFactor); int colorG = (int)(baseG * distanceFactor); int colorB = (int)(baseB * distanceFactor); string wallColor = $"\u001b[38;2;{colorR};{colorG};{colorB}m"; // Darken colors for y-sides to add depth if (side == 1) { colorR = Math.Max(colorR - 30, 0); colorG = Math.Max(colorG - 30, 0); colorB = Math.Max(colorB - 30, 0); wallColor = $"\u001b[38;2;{colorR};{colorG};{colorB}m"; } for (int y = drawStart; y <= drawEnd; y++) { if (y >= 0 && y < screenHeight && x >= 0 && x < screenWidth) { // Set wall color colorBuffer[y, x] = wallColor; screenBuffer[y, x] = '\u2588'; // Full block character } }}
// Ceiling: Bright yellow for (int y = 0; y < drawStart; y++) { if (y >= 0 && y < screenHeight && x >= 0 && x < screenWidth) { colorBuffer[y, x] = "\u001b[38;2;111;99;39m"; screenBuffer[y, x] = '\u2588'; // Full block character } }
// Floor: Dark yellow for (int y = drawEnd + 1; y < screenHeight; y++) { if (y >= 0 && y < screenHeight && x >= 0 && x < screenWidth) { //65541e colorBuffer[y, x] = "\u001b[38;2;101;84;30m"; screenBuffer[y, x] = '\u2588'; // Full block character } }
give the ceiling a square tiles texture (lines forming a 3x3 grid consistent with the ceiling) and the floor a carpet like texture (darker colors spread out like each 3 pixels)
- Assistant