By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,971 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,971 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.