United States (English)
Canada (English)
Canada (Français)
Deutschland (Deutsch)
España (Español)
France (Français)
Italia (Italia)
United Kingdom (English)
United States (English)
日本 (日本語)
Forums
Hi,
Visitor
Sign In
Home
Quick Start Guide
News
Membership
Games
Games Catalog
Submit Game
Review Game
Playtest Game
Creators
My Profile
My Business
Community
Forums
Community Spotlight
Community Resources
Education
Getting Started
Education Catalog
Starter Kits
Utilities
Resources
FAQ
Partners
Download
Feedback
Press Site
community forums
XNA Community Forums
»
XNA Game Studio Technologies (Xbox 360, Zune, and Windows)
»
General
»
Destroying unused objects or reusing?
More Search Options
|
My Discussions
|
Active Topics
|
Not Read
Page 1 of 1 (4 items)
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
Destroying unused objects or reusing?
Last post 4/16/2009 9:17 AM by
Rizman
. 3 replies.
4/16/2009 3:39 AM
Zepher
(0)
Posts
125
Destroying unused objects or reusing?
Reply
Quote
I am creating a Tower Defense game and I have started to create the missiles that will be fired from my towers. What is the best way to handle these missile objects? The two methods I have thought of:
1. Initialize and create enough missiles that you can use an 'alive' bool to create and reuse these missiles.
2. Create a missile each time a bullet is fired and destroy it when it hits its target.
Which is the better approach or is there something else I should be considering? Thanks!
4/16/2009 3:45 AM
In reply to
Craig Martin
(3541)
Posts
2,468
Re: Destroying unused objects or reusing?
Reply
Quote
If you plan to deploy to XBox then 1. is the recommended techique.
Game hobbyist hell-bent on coding a diabolical Matrix
4/16/2009 4:19 AM
In reply to
Zepher
(0)
Posts
125
Re: Destroying unused objects or reusing?
Reply
Quote
Okay, thanks, that is exactly what am planning to do so I'll take that approach, I appreciate the fast response :)
4/16/2009 9:17 AM
In reply to
Rizman
(180)
Posts
175
Re: Destroying unused objects or reusing?
Reply
Quote
You should absolutely use number 1).
Here is a very good blog entry about resource pools which you should really read.
Advice from the swamp: A generic pool collection class
Page 1 of 1 (4 items)
Previous
Next
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
Privacy Statement
Code of Conduct
Feedback