472,141 Members | 950 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

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"

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?

Nov 16 '05 #1
0 1242

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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.