How do I check if something is correct

0 favourites
  • 3 posts
  • Hello guys, so I'm kind a new here, and I have question. I'm creating a drag&drop chemistry game and I need to check whether player did proper atoms combination or not. It might be hard for you to understand, but I will try to show it in picture here

    Your help is really appreciated, thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I hope you have the full version, then you can use different objects for indexes and ions.

    The idea would be letting the program read the table from left to right.

    Add the ions and indizes and brackets to a family. Set their origin points to somewhere on the left edge for best results. Assign a family variable called charge. For ions set it to their corresponding charge. For indexes and brackets set it to 0.

    Now you could do a for each (ordered) for that family to read from left to right. Create an invisible box that marks your playing field and do an overlap check or restrict the allowed x and y to only catch stuff in the playing field.

    So it goes from left to right, you read the charges from the family instance variable. You need to add the logic behind the brackets and indizes to your reading logic. You should end up with the charge of the expression when you do it right. You might want to also check if the ions/symbols are near enough to each other (correctly aligned)

    Another approach would be the indizes and brackets snapping to ions and they directly influence the charges of the ions. Then you just select all ions that are in the playing area and sum up their collective charge. Etc. Many different solutions thinkable.

  • Thanks! Now I got and idea how it all should work, and it's only matter of a job

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)