Computer Science Canada 2 directional buttons? |
Author: | Darkshining [ Tue Sep 20, 2005 7:13 pm ] | ||||
Post subject: | 2 directional buttons? | ||||
How do you use two directional buttons at once?
like this?
|
Author: | Mazer [ Tue Sep 20, 2005 7:20 pm ] | ||
Post subject: | Re: 2 directional buttons? | ||
Thusly
|
Author: | Darkshining [ Tue Sep 20, 2005 7:22 pm ] |
Post subject: | |
Ohh, thank you, i didn't know you can't put two keys in one bracket. oh, one small problem, the program runs, but when you press KEY_UP_ARROW and KEY_RIGHT_ARROW or KEY_UP_ARROW and KEY_LEFT_ARROW it doesn't not respond the way it was supposed to. it just goes up. how can i make it go diagonal? |
Author: | Cervantes [ Tue Sep 20, 2005 7:35 pm ] |
Post subject: | |
Don't use elsifs. Just use four ifs. Do it, and you should see why. |
Author: | Darkshining [ Tue Sep 20, 2005 7:44 pm ] | ||
Post subject: | |||
Like this? this one has two errors, don't you have to use ifs with at least one else? and syntax error at end loop for some reason?
|
Author: | jamonathin [ Tue Sep 20, 2005 8:16 pm ] | ||||||
Post subject: | |||||||
Maybe you should take a quick glance at an 'if' tutorial. I can go . . .
and that's One if statement. Or i can go
And there's two if statements. Your problem is you didn't put any 'end ifs' at the, well, end of your ifs. Oh, and mite i add, put ONE delay, at the end of your loop, not in every if statement.
|
Author: | Darkshining [ Tue Sep 20, 2005 8:39 pm ] |
Post subject: | |
Thank you, i just want to add i started learning Turing one week ago. oh, this seems like a silly question but, how do you draw a semicircle? |
Author: | Mr. T [ Tue Sep 20, 2005 8:55 pm ] |
Post subject: | AlexYoung |
Draw a circle using the Draw.Oval command, then cover half the circle with a square (Draw.Box) that is the same colour as the background. |
Author: | beard0 [ Tue Sep 20, 2005 9:14 pm ] |
Post subject: | Re: AlexYoung |
Pwned wrote: Draw a circle using the Draw.Oval command, then cover half the circle with a square (Draw.Box) that is the same colour as the background.
Ouch!!!! Please no, use Draw.Arc, and just use initial and final angles 180 degrees apart. Also, Darkshining wrote: don't you have to use ifs with at least one else
This is seen by some as a good coding practice. They think that it makes it more clear if when you want to do something in one case only, that you explicitly state that you want to do nothing otherwise. This is not my view; I'm simply relaying this as a possible explanation as to why Darkshining may have thought this neccessary. |
Author: | jamonathin [ Wed Sep 21, 2005 7:51 am ] |
Post subject: | |
One thing you may want to remember, is your good buddy F10. Just go to search, and type in whatever you want to look for. For example if there's something you want to draw, type 'draw'. |