Skip to main content
GameDev.net gamedev.net
🔒 Locked

Passing boolean variables between classes

Started by duder673 Apr 8, 2009 at 4:18 PM 0 replies 600+ views
Original Post
duder673
duder673
I am having trouble making my animations play all the way through in XNA and I am pretty sure that I could get it to work if I could send a boolean variable from my UserControlledSprite.cs class to my Sprite.cs class and then change it to false and send it back to UserControlledSprite.cs after all of the frames have played through. Is there a way to send that variable back and forth between two classes? UserControlledSprite.cs bool boolvar = true; | V Sprite.cs boolvar = true; play through all frames; boolvar = false; | V UserControlledSprite.cs boolvar = false; Any help would be greatly appreciated. Or if you know a better way to do this.
Doggan
Doggan
Pass the variable as a ref parameter.

Or use a basic event notification system.

etc..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.