XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

BG 2D Game Particle tutorial - inconsistent accessibility

Last post 7/4/2009 3:14 PM by Craig Martin. 2 replies.
  • 6/13/2009 1:25 AM

    BG 2D Game Particle tutorial - inconsistent accessibility

    So I've done the first 2D game tutorial and it all went okay, so then I went on to the particle tutorial and all was, seemingly, well.
    However I got a bunch of errors when trying to build the semi-final result (as in, before making the smoke particle effect), most of them where just sloppy writing on my part but one of them leaves me clueless.

    It appears in particleSystem.cs in the " protected virtual void InitializeParticle(Particle p, Vector2 where) " function. Apparently it's the "InitializeParticle" part that is wrong.

    This is the message the error list gives me.

    Inconsistent accessibility: parameter type 'BeginnersGuide_2DGame_Windows.Particles.Particle' is less accessible than method 'BeginnersGuide_2DGame_Windows.Particles.particleSystem.InitializeParticle(BeginnersGuide_2DGame_Windows.Particles.Particle, Microsoft.Xna.Framework.Vector2)'

    I've been very careful to write the code down as it appears in the videos (I also have the source code open in another project window so that I can crosscheck if there' re faults. But with this, I am stumped. Hope you guys can point out what needs to be done.

    And with that I'll take my own advise from the Let's Create a Good Design Handbook thread and get some sleep. Maybe I'll figure it out tomorrow.

    Thanks in advance.
    www.inkBot.se
  • 7/4/2009 3:10 PM In reply to

    Re: BG 2D Game Particle tutorial - inconsistent accessibility

    I have a simular error in my current project unfortunately.

    So i've been looking for a solution aswell.

    What I found out about this is that it is usually caused by calling a class as a type, 
    but the class isn't public or accessible to the line you are calling it to.

    If that doesn't fix it, you're in for a long search.

    Good luck!

    I'll be checking back here to see if anyone found out what this error indicates exactly.
  • 7/4/2009 3:14 PM In reply to

    Re: BG 2D Game Particle tutorial - inconsistent accessibility

    The InitializeParticle method is protected. So the Particle class/struct must be at least protected. I guess in your case it is private. If you make the Particle class/struct protected the error will be fixed.
    Game hobbyist hell-bent on coding a diabolical Matrix
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG