viney12 Posted November 30, 2022 Share Posted November 30, 2022 hey guys, my goal is to create worms-like game clone, and I'm trying to wrap my head around terrain related stuff. let's say I want the map that the game is taking place on to be 1000x1000 pixels, the terrain itself has to be destructible - just like in the worms games series. what would be the best way to represent such map in code? I feel like simple 2d 1000x1000 array with ones and zeros is not an optimal solution, but at the same time I think that with such structure it would be very easy to detect collisions and destroy terrain accordingly. do you guys have any recommendations, directions or general tips for me? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 1, 2022 Share Posted December 1, 2022 use bitmasks and it'll be /8 or /32 depends on your perspective Also you destroy , but for physics you probably should know sum in an area, its also easy to calc viney12 1 Quote Link to comment Share on other sites More sharing options...
viney12 Posted December 1, 2022 Author Share Posted December 1, 2022 thank you for directing me, so as I understand bitmasking is a way to "know" which graphical tile to render for particular space after destruction or am I missing something? so the map itself still needs to be stored in an 2d 1000x1000 array where each value corresponds to a single pixel, correct? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.