I’m trying to make the sprites fall down, they do, but they are not in the screen
supportedOrientations(LANDSCAPE_ANY)
displayMode(FULLSCREEN)
function setup()
score=0
x=100
y=150
v=0
gameOver=false
jump=false
timer=false
clockJump=0
can=true
en={}
createEnemy()
scoree=0
end
function draw()
background(255, 255, 255, 255)
fill(0, 255, 178, 255)
sprite("Cargo Bot:Made With Codea",900,30)
text("SCORE "..score,WIDTH/1.12,HEIGHT-15)
text(clockJump,WIDTH/2,HEIGHT/2)
rect(WIDTH/1500,1,1298,80)
rect(WIDTH/130,HEIGHT/1,1300,200)
if gameOver then
endScreen()
else
fill(48, 0, 255, 255)
sprite("Documents:hh",x,y)
calcY()
addScore()
showEnemy()
checkCollision()
end
if jump == true then
y=220
end
if timer == true then
clockJump=clockJump+1
end
if clockJump>40 then
stopJump=true
timer=false
clockJump=0
y=150
jump=false
end
if can == true then
end
end
function calcY()
x=x+v
if x>850 then
x=850
end
if HEIGHT>700 then
HEIGHT=700
end
if x<=100 then
x=100
end
end
function addScore()
scoree=scoree+1
if scoree%2000==0 then
table.insert(en,vec2(math.random(WIDTH,WIDTH+100),math.random(0,HEIGHT)))
end
end
function checkCollision()
v1=vec2(x,y)
for a,b in pairs(en) do
d=v1:dist(vec2(b.x,b.y))
if d<200 then
score=score+1
end
end
end
function endScreen()
background(255, 255, 255, 255)
fontSize(40)
text("Double tap screen to restart",WIDTH/2,HEIGHT/28.5)
fill(148, 42, 42, 255)
font("Futura-CondensedExtraBold")
end
function touched(t)
if t.state==BEGAN then -- move sprite up
if gameOver and t.tapCount==2 then
restart()
end
v=3
end
if t.state==ENDED then -- move sprite down
v=0
end
if t.tapCount == 2 then
jump=true
timer=true
end
end
function createEnemy()
for z= 1,1 do
table.insert(en,vec2(math.random(WIDTH,WIDTH),math.random(HEIGHT,HEIGHT)))
end
end
function showEnemy()
for a,b in pairs(en) do
fill(255, 0, 0, 255)
sprite("Documents:redcann",b.x,b.y)
b.y=b.y-4
if b.y<0 then
b.x=math.random(WIDTH,WIDTH+200)
b.y=math.random(0,HEIGHT)
end
end
end