Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #4685
| From | "BartC" <bc@freeuk.com> |
|---|---|
| Newsgroups | comp.programming |
| References | <d833e796-13fa-40e8-91ea-143c547f7603@googlegroups.com> |
| Subject | Re: data structure curiosity |
| Message-ID | <wXUDv.36651$3K3.17080@fx24.am4> (permalink) |
| Organization | virginmedia.com |
| Date | 2014-08-05 00:46 +0100 |
"b" <mike7411@gmail.com> wrote in message news:d833e796-13fa-40e8-91ea-143c547f7603@googlegroups.com... > What would be the most appropriate data structure to represent the > ground in a game such as this? > > https://play.google.com/store/apps/details?id=cz.gdmt.AnnelidsDemo > > I guess you could just use a really big 2d array, but I would hope there > is something smarter. How big is the 'world' the game is played in? From what I could see of the video, it's not too extensive, and not particularly hi-res either. So a two-level bit image would do for the main ground layer (the one that's destroyed as the game proceeds). (And which is displayed as a textured and shadowed transparent layer over the darker textured background.) However, using a 256-level image would be simpler and faster to manipulate, and lets you directly code it as an array, as not too many languages give you bit-arrays to work with directly. It needs quite a bit more memory though. -- Bartc
Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread
data structure curiosity b <mike7411@gmail.com> - 2014-08-02 22:50 -0700 Re: data structure curiosity Richard Heathfield <invalid@see.sig.invalid> - 2014-08-03 08:16 +0100 Re: data structure curiosity Öö Tiib <ootiib@hot.ee> - 2014-08-04 09:56 -0700 Re: data structure curiosity "BartC" <bc@freeuk.com> - 2014-08-05 00:46 +0100
csiph-web