Ok so in my high school I’m taking an intro to programming class and we are using Codea as our base programming system. I’m trying to create a flappy bird simulation like the demo version given. Except I’m not allowed to use tables or anything really complicated. Just a base game of a “bird” jumping up and down through pipes that spawn randomly with a gap between the pipes that stays the same. It has to keep track of score too. I got the bird done and I’ve begun working on just getting the first pipe to spawn but w/o collision detection. I ran into and error with it and I could use some help with getting the pipe to run off the screen then resplendent a different hight here’s my code
function setup()
x=100
y=300
radius=50
speedY=-3
speedX=-3
x1=WIDTH
y1=math.random(0,-WIDTH)
pipeH=HEIGHT --this variable isn't being used yet it's for later
print(HEIGHT,WIDTH)
gap=200
end
function draw()
background(109, 226, 36, 255)
fill(255, 0, 0, 255)
ellipse(x,y,radius)
y=y+speedY
speedY=speedY-.2
if speedY>6.5 then speedY=6.5
end
if speedY<-6.5 then speedY=-6.5
end
rect(x1,y1,50,250)
x1=x1+speedX
if x1<=-50 then x1=WIDTH
end
end
function touched(touch)
if touch.state==BEGAN
then speedY=speedY+13
print("touch")
end
end