I made a Rubik's cube on Replicube

  • Thread starter Thread starter Deleted member 36445
  • Start date Start date
D

Deleted member 36445

Guest
I found this cool game where you have to complete challenges by writing shaders to replicate simple voxel models


1759498120561.jpeg


1759498132618.jpeg


1759498138820.jpeg


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
 
You have to pay money to write code? Just write real opengl shaders at that point lmao
Cool examples https://www.shadertoy.com/
I don't "pay money to write code".

I bought a good game that I liked and I think it's worth the money.

by the way you spent hundreds of hours on factorio so I don't see why you're talking about paying money to code or to work or anything like that.

anyone if free to buy games they enjoy.

I'm know shadertoy for a few years but it's not the same thing. Replicube has a good learning curve, a nice community an weekly challenges. Shadertoy is not as welcoming for my taste
 
I don't "pay money to write code".

I bought a good game that I liked and I think it's worth the money.

by the way you spent hundreds of hours on factorio so I don't see why you're talking about paying money to code or to work or anything like that.

anyone if free to buy games they enjoy.

I'm know shadertoy for a few years but it's not the same thing. Replicube has a good learning curve, a nice community an weekly challenges. Shadertoy is not as welcoming for my taste

yeah in factorio I don't have a text box typing in if / then statements. whether or not it's a good game doesn't make a difference on 1. is it paid 2. do you write code. even if that is reductive to the gameplay.

but whatever floats your boat. it just seems like it's pretty close to just writing p5.js which is friendlier than opengl.
 
Back
Top