How do I check if something is correct

Get help using Construct 2

Post » Fri Apr 10, 2015 3:47 pm

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 Image

Your help is really appreciated, thanks!
B
3
Posts: 2
Reputation: 179

Post » Fri Apr 10, 2015 5:10 pm

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.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Apr 10, 2015 5:40 pm

Thanks! Now I got and idea how it all should work, and it's only matter of a job :)
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: tikuna and 10 guests