Jump to content
  • Advertisement
Sign in to follow this  
Bruno Filip

bool as class item argument

This topic is 1116 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

Hy everyone, I need help, I want to add bool as argument to my Item class, so here is a pieve of code from a class file:

class Item : Sprite
        public bool Check1;

        public Item(Texture2D newTexture, Rectangle newRectangle, bool newCheck)
            Check1 = newCheck;
            texturee = newTexture;
            rectan = newRectangle;

And here is created Item in Game1.cs

ball = new Item(Content.Load<Texture2D>("ball"), new Rectangle(80, 80, 80, 80), new bool());

Now I have no idea how can I reach that bool, I have tried something like: 

ball.bool(Check1) = true;


ball.Check1 = true;


ball.bool = ture

but It doesnt work I don't know how to make it work :/ Can somebody help me ?

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!