Advertisement Jump to content
Sign in to follow this  

what data structure do i use in

This topic is 3838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am unsure of the best data structure to use in for this game I have made 'without classes' but I am going to change this. I have an array of objects 'called enemies' which each enemy has an Array property that is 'missile' . Missile has properties and methods. Each enemy and missile has a boolean value. I want to create a list of enemies and missiles of that enemy which have Boolean values set to false.That way i can just check the list for relevant values instead of scrolling through the all objects and testing the property for true false. So what i want to do is have 3 classes. class1 -will create a new enemy with a call to class2 and contain a list of enemies with a property set to false. class2 - will contain properties and methods to for a enemy. One property will be a missile which will contain an array of objects and contain a list of missiles with a property set to false. class3 - will contain proerties and methods to for a missile i thought about extending a collection class but this is getting too confusing for me. THis way i have 3 classes and create 2 lists of objects where a property is set to false. also collections are said to be 10 times slower than arrays which complicates matters [Edited by - jagguy2 on July 19, 2008 8:17:04 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!