Creating and drawing polygons
Posted: Thu Oct 29, 2020 10:00 pm
I'm creating a pinball-like game, where a ball collides with convex polygons, as defined by a list of vertices and other parameters like bounciness, movement path, etc. You can see a screenshot of the game below.
Everything works well, including collisions, but I have two problems I would like to resolve
1) Currently, I input the location and shape of every polygon as text in a .lua file. This is obviously very tedious. Is there some external program where I could visually draw some polygons, and export it as a list of vertices (and other parameters) that I can then import as a .lua?
2) I draw every polygon with love.graphics.polygon(), but I've heard meshes are more efficient. I can draw the polygons with meshes, but the problem is that I also use a budget glow effect by drawing several copies of each polygon below it with low transparency and varying linewidth. Can I mimic this with meshes, without creating several separate meshes for each polygon? Also, I always draw < 100 polygon per frame.. is it even worth it to use meshes?
Thanks!
Everything works well, including collisions, but I have two problems I would like to resolve
1) Currently, I input the location and shape of every polygon as text in a .lua file. This is obviously very tedious. Is there some external program where I could visually draw some polygons, and export it as a list of vertices (and other parameters) that I can then import as a .lua?
2) I draw every polygon with love.graphics.polygon(), but I've heard meshes are more efficient. I can draw the polygons with meshes, but the problem is that I also use a budget glow effect by drawing several copies of each polygon below it with low transparency and varying linewidth. Can I mimic this with meshes, without creating several separate meshes for each polygon? Also, I always draw < 100 polygon per frame.. is it even worth it to use meshes?
Thanks!