@DrSurname I made my own little program and it looks pretty terrible because I didn’t give it much time. The goal was to make it look as close to Flappy Bird as possible, but this was the best I got.
--# Main
-- Generating Pipes
displayMode(FULLSCREEN)
spaceBetweenPipes=225
function setup()
pipes={}
m=mesh()
m.shader=shader(beam.v,beam.f)
m.shader.mainCol=vec4(1,1,1,1)
pipeCol=color(26, 170, 20, 255)
m.shader.subCol=vec4(pipeCol.r/255,pipeCol.g/255,pipeCol.b/255,pipeCol.a/255)
m.shader.alpha=1
m.shader.vertical=false
mm=mesh()
mm.shader=shader(beam.v,beam.f)
mm.shader.mainCol=m.shader.mainCol*.95
mm.shader.subCol=m.shader.subCol
mm.shader.alpha=m.shader.alpha
speed=5
gap=300
end
function draw()
background(88, 215, 216, 255)
if #pipes==0 or (pipes[#pipes].bottom.boundaries.x<=WIDTH-gap) then
local data={x=WIDTH,length=math.random(30,HEIGHT*3/4),width=100}
data.boundaries=vec4(data.x+data.width/2,data.length/2,data.width,data.length)
data.index=m:addRect(data.boundaries:unpack())
data.top=mm:addRect(0,0,0,0)
local top={x=data.x,length=HEIGHT-spaceBetweenPipes-data.length,width=data.width}
top.boundaries=vec4(top.x+top.width/2,HEIGHT-top.length/2,top.width,top.length)
top.index=m:addRect(top.boundaries:unpack())
top.top=mm:addRect(0,0,0,0)
local p={bottom=data,top=top}
table.insert(pipes,p)
end
for k,v in ipairs(pipes)do
v.bottom.boundaries.x = v.bottom.boundaries.x - speed
m:setRect(v.bottom.index,v.bottom.boundaries:unpack())
v.top.boundaries.x=v.bottom.boundaries.x
m:setRect(v.top.index,v.top.boundaries:unpack())
local sch=vec2(1.2,50)
mm:setRect(v.bottom.top,v.bottom.boundaries.x,v.bottom.boundaries.y+v.bottom.length
/2,v.bottom.width*sch.x,sch.y)
mm:setRect(v.top.top,v.top.boundaries.x,v.top.boundaries.y-v.top.length/2,
v.top.width*sch.x,sch.y)
end
m:draw()
mm:draw()
end
beam={
v=
[[uniform mat4 modelViewProjection;
attribute vec4 position;
attribute vec4 color;
attribute vec2 texCoord;
varying highp vec2 vTexCoord;
void main()
{
vTexCoord = texCoord;
gl_Position = modelViewProjection * position;
}]],
f=
[[
precision highp float;
uniform lowp vec4 mainCol;
uniform lowp vec4 subCol;
uniform bool vertical;
uniform float alpha;
varying highp vec2 vTexCoord;
void main()
{
lowp float c=vTexCoord.x;
if (vertical) c=vTexCoord.y;
highp vec4 col=mix(mainCol,subCol,abs(c-0.5));
gl_FragColor = vec4(col.rgb*alpha,alpha);
}
]]
}