///|
// Simple texture system for wall textures
///|
struct TextureData {
width : Int
height : Int
pixels : Array[String] // Array of hex color strings
}
///|
// Create a simple brick texture pattern
fn create_brick_texture() -> TextureData {
let width = 64
let height = 64
let pixels = []
for y in 0.. "#8B4513" // Standard brown
// 1 => "#A0522D" // Sienna
// _ => "#CD853F" // Sandy brown
// }
// }
let variation = (x + y) % 3
let color = match variation {
0 => "#8B4513" // Standard brown
1 => "#A0522D" // Sienna
_ => "#CD853F" // Sandy brown
}
pixels.push(color)
}
}
{ width, height, pixels }
}
///|
// Create a stone texture pattern
fn create_stone_texture() -> TextureData {
let width = 64
let height = 64
let pixels = []
for y in 0.. String {
let wrapped_x = x % texture.width
let wrapped_y = y % texture.height
let index = wrapped_y * texture.width + wrapped_x
texture.pixels[index]
}
///|
// Get texture based on wall type (can be extended for different wall types)
fn get_wall_texture(wall_type : Int) -> TextureData {
match wall_type {
1 => brick_texture
_ => stone_texture
}
}