Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

What the hell.... [Strange Error Im having trouble with]

So in my code I call a check data.include?(X) where x is a key like :draggable, or :has_rarity

For some reason my script is throwing back an error:
c57c58200125a5ae9c859d25e4d59def.png


Saying that it cant convert my True or False Include statement to a color


It's confusing the fuck out of me because I issued every check I know to make sure thats not whats going on. I checked for any open Color classes and there is none, if I set the 2 variables to false / true the error goes away but if I do a data.include?() of any kind, on a string, a float, a numeric, or a symbol is throws the error.

So what the hell is going on? It is obviously a problem with the class :P just don't know what!

If I figure it out ill make sure to update! if you need some of the source let me know!
 
Saying that it cant convert my True or False Include statement to a color
I don't think its complaining about that. It seems like you're giving data the symbol :draggable but it for some reason wants you to pass a Color instead.

Is data a regular instance of a Hash Array?


EDIT: Disregard all that, I have no idea what I'm talking about. From the looks of things, data is an array which you give values. I have no idea how symbols work though, but I'm assuming you pass [:draggable] as data and run a test on it that way.

Even though it's not as clean, I'd probably just use an enumerator or strings instead. I don't quite understand symbols or why to use them.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top