I solved it, thanks for your responses .:)

El dia dimarts, 26 de gener de 2021 a les 9:39:24 UTC+1, Ivo Fokkema va 
escriure:

> I'm not sure if this is of any help, but when I had the same issue and I 
> looked at ScrollableLayer, it seemed like I had to create a very, very 
> large image. So I decided to use a trick instead:
>
> background.do(Repeat(MoveBy((-500, 0), (500/SCROLLING_SPEED)) + 
> MoveBy((500, 0), 0)))
>
> What this does is it moves the image visibly to the left by 500 pixels in 
> a certain amount of time (depending on the scrolling speed (set to 0-100)), 
> and then quickly moves it back to the right by 500 pixels. This last 
> movement isn't visible to the human eye if your image's pattern repeats 
> every 500 pixels, but it "resets" the image position so you don't need a 
> huge image for your level. The same image just moves left and right 
> continuously.
>
> I'm not saying this is better, but it is just one line of code so might 
> help you out 😅
>
> Cheers,
>
> Ivo
>
> On Sat, Jan 23, 2021 at 2:36 PM Toni Roca <[email protected]> wrote:
>
>> I making a space game, and i need a infinite background loop.
>> And the question is , i need use a tiled map or a ScrollableLayer?
>>
>> Thanks all.
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "cocos2d discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/cocos-discuss/1238b3eb-f6dc-48d7-a75e-9b234415142cn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/cocos-discuss/1238b3eb-f6dc-48d7-a75e-9b234415142cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cocos-discuss/8b7687d7-d0ab-400c-aece-0cc69038806cn%40googlegroups.com.

Reply via email to