Computer Science Canada Turing chaging screen/clear screen help |
Author: | turinguser4000 [ Wed Dec 11, 2013 1:58 am ] | ||
Post subject: | Turing chaging screen/clear screen help | ||
What is it you are trying to achieve? <Chaging the room or clearing a screen to start a new one, i want the stickman to enter the house and to make a new screen for the house> What is the problem you are having? i don't know how to clear the screen Describe what you have tried to solve this problem i have tried using cls, and drawing over the first picture> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1 |
Author: | Insectoid [ Wed Dec 11, 2013 7:21 am ] |
Post subject: | RE:Turing chaging screen/clear screen help |
You're probably having an issue because you're drawing the new scene, and then drawing the old scene right on top of it. You need a way to keep track of which scene you're drawing, so that you don't draw any others. To make this easy, I recommend moving all of your scenes into their own procedures, and only calling the procedure that corresponds to the scene you want to draw. |
Author: | turinguser4000 [ Wed Dec 11, 2013 8:36 am ] |
Post subject: | Re: Turing chaging screen/clear screen help |
I'm still kind of new to turing can you tell me what you mean by moving all of the scenes to their own procedure? |
Author: | Raknarg [ Wed Dec 11, 2013 10:31 am ] | ||
Post subject: | RE:Turing chaging screen/clear screen help | ||
Sometimes it's easier to encapsulate code snippets inside procedures. What they do is basically whenever you call them, they;ll just perform thecode that's inside them. For instance:
Now every time you put hello_world in your program it'll just perform the code inside it, which is putting "Hello World" on the screen. Procedures can do more but that should be fie for now. You can look at them more in the Turing Walkthrough |
Author: | turinguser4000 [ Wed Dec 11, 2013 4:41 pm ] |
Post subject: | Re: Turing chaging screen/clear screen help |
so in my situation where and how should i add the procedure command? |
Author: | Insectoid [ Wed Dec 11, 2013 4:55 pm ] | ||
Post subject: | RE:Turing chaging screen/clear screen help | ||
Ideally, you'll have a procedure for each scene. for example,
|
Author: | turinguser4000 [ Wed Dec 11, 2013 10:38 pm ] | ||||
Post subject: | Re: Turing chaging screen/clear screen help | ||||
Sorry if my question is already answered in any of the previous posts but after using procedure i now have something like this :
unfortunately i still have the same problem when i press p to enter the house the screen only flickers. I'm also not sure what you mean by : %You might need some way to keep track of which scene you're trying to draw. How about using an integer? var scene : int := 0 how do i call which scene goes in which? Mod Edit: Please wrap you code in either of the following in order to preserve whitespace (indentation) and to highlight the syntax.
|
Author: | Raknarg [ Thu Dec 12, 2013 10:32 am ] |
Post subject: | RE:Turing chaging screen/clear screen help |
Yes, an integer would do fine. Good thinking. It looks like you've got an if to tell you when you've entered the house. You also have an integer that keeps track of whether or not you have entered the house. What should happen when you enter the house, code wise? (hint: it's something to do with these two ideas, you almost have it) |