Page 1 of 1

"Proceed if requirements are fulfilled"

Posted: Mon Apr 11, 2016 10:47 pm
by Noytal
I am making a puzzle game, and I need to make a "submit" button that checks if the player's solution is correct. Basically, it's a "move two match sticks to make 4 squares the same size" level, and I have a layout of matches that snap to a grid. I need to make a button that will "go to the 'correct answer' screen if the matches are in the correct place" or something along those lines.

How would I go about doing this?

Re: "Proceed if requirements are fulfilled"

Posted: Tue Apr 12, 2016 12:20 am
by KimD
It is a little hard to answer your question because there are so many ways to do this. One option would be:

1) Within whatever handler you have that allows the user to move a match - at the end of that handler test whether all of the matches are in the right place
If (/* all the matches are in the right place */) then
put true into usergotitright
Else
put false into usergotitright
End if


2) Then add a submit button to your card, with code along the lines of
end mouseup
If usergotitright=true then
go to card "CorrectAnswer"
else
Answer "Try again Loser"
end if
end mouseup

Re: "Proceed if requirements are fulfilled"

Posted: Tue Apr 12, 2016 8:45 pm
by dunbarx
What Kim said.

Are all the matches moveable? I assume so. Do you have any thoughts about how to determine whether a "match" is properly placed? Especially if they can be oriented vertically or horizontally? Do you use the "grab" command to move? Or the "move" command, perhaps setting the start and end with two mouseClicks? Or something else?

Craig Newman