2 Replies - 817 Views - Last Post: 11 April 2012 - 05:11 AM

#1 gruffy  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 106
  • Joined: 28-April 11

xna side scroller, refactored and now stumped on implementing bullets

Posted 04 April 2012 - 07:58 AM

I have a project that i built following the xna game dev tut.XNA4 AppHub
I then realised, though it was good, it was not optimally coded for OO, now im no expert but im starting to understand the language so i have refactored it.
My sprites now all derive from a base type & each derived sprite has its own logic and AI.
I have a manager class to handle sprite object instantiation.
I did change audio to xact but then realised wp7 does not support, so changed this back to rudimentary wavs (shame on u WP7!)
My game1 class now looks beautifully slim and the game runs well, but im missing my projectiles!!!

I have a few styles of projectile code i would like to try out but cant seem to figure out the best place for it to go in my code.

I can see that i could easily handle this in game 1 but am leaving the confines of strict oo if i do this and i feel it would be better situated in the playerSprite class and implemented through my sprite manager class as the projectile in general will be of a blitted bitmap animation.

Its pretty frustrating this and im just a bit at the end of my tether thinking about it (brainmelt imminent).
I have enclosed an image depicting my class dependencies and the projectile class including methods it contains...
I would be very grateful is someone can see what ive got here and possibly guide me as to the best place to position my bullet/projectile code with in this structure.
The project is getting fairly large in debug mode cos of extra additions like images and audio that are not used yet or yet to be discarded so i cannot upload entire project but can always post back any classes seperately if they will assist in deciphering this problem of mine.
If , at all, you could tell me why the choice proposed would be considered optimum, i may get a small learning experience out of it too, which would be nice.
With anticipated thanks for reading.
Gruffy, the humbled recipient of your digi-wisdoms!

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: xna side scroller, refactored and now stumped on implementing bullets

#2 pworlds  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-April 12

Re: xna side scroller, refactored and now stumped on implementing bullets

Posted 10 April 2012 - 06:14 PM

Hello bro,

Sorry, I don't have the answer to your question because I am a noob. I just wanted to ask how you generated that visual map of your XNA classes and methods. Is there some program that does this for you? Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 gruffy  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 106
  • Joined: 28-April 11

Re: xna side scroller, refactored and now stumped on implementing bullets

Posted 11 April 2012 - 05:11 AM

View Postpworlds, on 10 April 2012 - 06:14 PM, said:

Hello bro,

Sorry, I don't have the answer to your question because I am a noob. I just wanted to ask how you generated that visual map of your XNA classes and methods. Is there some program that does this for you? Thanks.



Hello bud, yes there is, this is available inside Visual Studio 2010 by right clicking the project and choosing to "generate class diagram"

Microsoft explanation
The above is a link to help you out, it shows you that you can effectively build a diagramatic map of classes, names spaces, components etc etc etc. Great little uml tool set inside visual studio 2010, but i have to say they are not always obvious!

There are NO noobs in my eyes, just padawans! :donatello:
Of which I would consider myself to be also.

gruffy :bananaman:

Have I labeled this wrong or something, or am I not being specific enough.
Admin advice would be appreciated cos I could really do with the help in solving this little confuser of mine.
Gruffy :)

This post has been edited by gruffy: 11 April 2012 - 05:09 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1