Then create a button and put the following code to it's actions: (To create a button create a box using one of the shape tools, then select the shape you just create and press F8 select the button option)

Shape Tools
on (release, keyPress "
if (g == n) {
s = "you got it";
}
if (g
}
if (g>n) {
s = "too high";
}
}
Explanation:
on (release, keyPress "
This code says that when the player either hits the enter key, or clicks the button, it will execute the rest of the code (g)
if (g == n) {
s = "you got it";
}
if (g
}
This part will check to see if the their guess (g) is lower then the number, if it is it will display "too low"
if (g>n) {
s = "too high";
}
}
Finally, this part checks to see if the guess is higher then the number and if it is it will display "too high"
| » Level Basic |
|
Added: 2005-06-22 Rating: 5 Votes: 8 |
| » Author |
| um... yea |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!