D
Deleted member 36445
Guest
I found this cool game where you have to complete challenges by writing shaders to replicate simple voxel models
store.steampowered.com
Here is the code (LUA)
Save 20% on Replicube on Steam
Replicube is an open-ended programming puzzle game/toy about writing code to replicate 3D voxel-based objects. Solve puzzles, pursue leaderboard glory, or just make art to share with the in-game community.
Here is the code (LUA)
Code:
function edge(a,b)
n = 4
return a == extent and b == extent or abs(a-n) == extent and abs(b) == extent or abs(a) == extent and abs(b-n) == extent
end
if
edge(x,y) or
edge(-x,-y) or
edge(-x,y) or
edge(x,-y) or
edge(x,z) or
edge(x,-z) or
edge(-x,z) or
edge(-x,-z) or
edge(-y,-z) or
edge(-y,z) or
edge(y,z) or
edge(y,-z)
then return BLACK
end
if x == extent then
return RED
end
if -x == extent then
return ORANGE
end
if y == extent then
return WHITE
end
if -y == extent then
return YELLOW
end
if z == extent then
return GREEN
end
if -z == extent then
return BLUE
end