Log In  


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

1


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.


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



[Please log in to post a comment]