I am trying to make a Background image scrolling endless, and repeating, Normaly i use this Code for Stuff i'm making on PC, but this time i have some trouble.
First of all the Code works, but only on PC, i'm trying to make it work on 3DS (LövePotion) and it seems that i can't set vars to other Value as 0 in the LOAD part (Sometimes, Somtimes it works, no idea what's the reason) so bgy2 is 0 wich makes the update part mostly useless. anyway, i gave up making it work with load other Values than 0 for the Background repeating part.
Now i'am trying to use ONLY the Update part for that (exept, bgy1 & bgy2 can still get load in Load but have to be 0) But i'am totaly freaking out, i don't get it to work, try'd a lot of things but nothing was even close. Now i want to start that problem from Zero again, but with a little help (hopefully from you guys)
Code: Select all
Screen Height is also 240
-- Load Part:
bgy1 = 0
bgy2 = konfetti_bg:getHeight() -- It's actually also 240
--
-- Update Part:
bgy1 = bgy1+(block_speed*dt)/3
bgy2 = bgy2+(block_speed*dt)/3
if bgy1 >= 240 then
bgy1 = -240
end
if bgy2 >= 240 then
bgy2 = -240
end
--