Hello, I'm new to LÖVE and coding in general. I'm trying to figure out how to make a side scroller with highly moldable terrain. Something visually similar to this: http://thisissand.com/ + Worms-like terrain.
Think of a 2d sandbox of sorts, where the player can pour in different materials, which are interactible and destructible. It does not need to be a physics simulation. Objects do not have to possess realistic behavior other than a visually appealing falling and stacking effect.
The naive solution I found was to simply add all the individual sprites and their respective positions and speed on a table of tables. As expected this brings the performance down very very quickly, and this is just to keep track of the sprites. Just looping through thousands of tables and doing nothing more already brings the FPS under 60.
Next attempt was to separate "active" sprites and "resting" sprites. Once a pixel hit the floor and stopped moving, I deleted from the active sprites table and added to a spritebatch. Performance is vastly improved, but I'm yet to figure how to pile up the sand, not to mention the "sliding sand" effect and collision detection with other entities.
Any ideas? Thanks in advance!
Malleable terrain system
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Malleable terrain system
Are you using canvases and spritebatches?
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 9 guests