Computer Science Canada Need help with 'Click to continue' code |
Author: | MrC [ Tue Mar 30, 2010 4:34 pm ] |
Post subject: | Need help with 'Click to continue' code |
Hello, I am writing a game with Turing 4.1. I'm a compsci teacher, and doing this for my own enrichment ... My program starts by drawing some graphics. Next, I attempt to draw a canvas over the existing graphics. Everything works fine ... Until I tried to create a "click to continue" portion of code. The program flow gets all messed up. Even though the loop that waits for a mouse click is at the very end of my program, it stops the drawing partway through and only continues after I click. The click is currently the last part of the program, so I can't figure out why this is happening. I can't paste my whole code because it involves importing graphics and maps from files, but I'll post the jist of the problem: % draw graphics % create a GUI.Canvas and display it % Draw some text into the canvas, including "click to continue" View.Update loop Mouse.Where(x, y, b) exit when b = 1 end loop When I remove the mouse command everything is drawn perfectly. When I put it back in, it stops drawing part way through and only finishes the drawing after I click. It just doesn't make sense! HELP please!! ![]() |
Author: | Tony [ Tue Mar 30, 2010 5:14 pm ] |
Post subject: | RE:Need help with \'Click to continue\' code |
The code sample doesn't demonstrate the described problem. Also, we have [ syntax="turing" ] tags to paste code into. |
Author: | MrC [ Tue Mar 30, 2010 5:18 pm ] | ||
Post subject: | RE:Need help with \'Click to continue\' code | ||
I fixed it. Here is the code that works:
Seems to work well. "canvas" is a pre-defined GUI canvas. |
Author: | USEC_OFFICER [ Tue Mar 30, 2010 6:45 pm ] |
Post subject: | RE:Need help with \'Click to continue\' code |
I don't see the difference between the two bits of code. (The important bits) However since the problem is solved, I hope your game turns out well. |
Author: | Euphoracle [ Tue Mar 30, 2010 7:14 pm ] |
Post subject: | RE:Need help with \'Click to continue\' code |
Look into Input.Pause. |
Author: | MrC [ Wed Mar 31, 2010 7:14 pm ] |
Post subject: | Re: RE:Need help with \'Click to continue\' code |
Euphoracle @ Tue Mar 30, 2010 7:14 pm wrote: Look into Input.Pause.
I'll check that out, thansk for the tip. Oh and I realize now that my question was in fact very unclear ![]() I'll post the game when (if ever) it is complete ![]() |
Author: | USEC_OFFICER [ Wed Mar 31, 2010 7:41 pm ] |
Post subject: | RE:Need help with \'Click to continue\' code |
Now I am even more confused. But still looking forward to it. |