Log In  

Cart #sutiyayupe-0 | 2024-02-13 | Code ▽ | Embed ▽ | No License
1

P#141472 2024-02-13 23:37

Interesting WIP approach to infinite scrolling. The cycling of map slices is seamless, but the despawning of tiles break the illusion.
The simplest way to deal with it would be to scroll SMB1 style (only to the right but you can go back left until you bump into the screen border).
If you want full scrolling, you need a way to retrieve the despawned tiles. The simplest way is to seed the random generator with the column x coordinate before respawning the column.
This way you have always the same infinite level.
If you want the level to be different each time you play, grab an offset at start of the game, and add the offset to the x when setting the random seed used for the column.

P#141483 2024-02-14 11:22

Hi, I'm working on an infinite scroll with this little one : https://www.lexaloffle.com/bbs/?tid=139974
It's vertical in that case, but adaptation should be ok.
It's keeping existing tiles in a table and looks to work fairly ok. Code is available in the cartridge, Grid thumbnail. If performance goes down, I'm thinking about drawing only visible items based on camera position.
Happy to discuss about that

P#141551 2024-02-16 08:21

[Please log in to post a comment]