469,943 Members | 2,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,943 developers. It's quick & easy.

Best way to store objects in grid? (Space invaders)

Hi all, I am just playing around with writing a simple space invaders game
and was wondering what was the best way to store the layout of the "aliens".

I am currently using a multi-dimensional array to store all the "invader"
objects..

invaders [5,3]

Which stores 15 invader objects (5 across, three down). When I want to
display the "aliens", or figure out which alien has been "shot", I simply
recurse through the array and display all the objects. This works fine but I
was wondering if anyone had any better ideas?

Cheers
Mark
Nov 16 '05 #1
0 1192

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by |-|erc | last post: by
14 posts views Thread by Howard | last post: by
12 posts views Thread by Perre Van Wilrijk | last post: by
4 posts views Thread by Tarun Mistry | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.