I’m trying to make something in 2d where once the player reaches the end of the level, they’re back at the beginning and it just keeps going like that. I could imagine how this could be done in terms of setting the player position, but if I have a scrolling parallax background, how would I make that match up reliably?

  • bstix@feddit.dk
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Either have the background sync up with the level at the place where the level loops, or don’t sync at all, by keeping two sets of player positions. One for the level, which you can reset when you want the player to restart and then one for the background which is reset/looped separately and independent on the level position.