Easily add 2d destructible terrain to any game with this library. Lightning fast performance and tonnes of flexibility makes this library the perfect choice for anyone wanting more than just blocks out of their terrain. Get started quickly and easily;
var cell_size = 16; global.terrain = terrain_create(cell_size);
Make sure to draw it;
Add a starting block of land;
// Density is between 0 (no ground) and 1 (ground) var density = 1; // Create terrain over the bottom half of the terrain grid var left = 0; var top = terrain_grid_get_height(global.terrain) / 2; var right = terrain_grid_get_width(global.terrain); var bottom = terrain_grid_get_height(global.terrain); terrain_density_set_region(global.terrain,left,top,right,bottom,density);
Set a texture for the ground;
Simple as that!
- v0.2 - Initial release
- v0.3 - Terrain edge tracing and physics volume (for use with box2d)
- v0.4 - Redraw speedups by limiting redraws to a single pass per frame
- v0.5 - HTML5 support
- v1.0 - Show time!
Why free & paid?
You may be asking "Why pay for this when I could just get it free from Github?" I hate keeping code behind a paywall but I also have to eat too! Think of this offering as a try-before-you-buy situation. It would be great if you can buy the extension, it supports me and helps me keep giving away code but if you feel you can't afford it, you could always fork the project, make improvements and help bug fix! Any support is appreciated.
Edited by Rani_sputnik, 30 October 2015 - 03:26 AM.