Computer Science Canada moving an animation with keyboard |
| Author: | Insectoid [ Mon Apr 28, 2008 6:16 pm ] | ||
| Post subject: | moving an animation with keyboard | ||
I am trying to write a simple program for my self-learning where there is a pacman (Very original, no?) whose mouth opens and closes while you move him about the screen. However, currently, he does not move. I know why, just, not how to fix it. Note-This is my first time trying out procedures, so no things like "Dude, that's not even close to how procedures work" or any similar things. And without further ado, Code!
|
|||
| Author: | CodeMonkey2000 [ Mon Apr 28, 2008 6:23 pm ] |
| Post subject: | RE:moving an animation with keyboard |
Look carefully at your program flow.... |
|
| Author: | Insectoid [ Mon Apr 28, 2008 6:28 pm ] |
| Post subject: | RE:moving an animation with keyboard |
Yes, I know it will loop pacman indefinitley. I don't know how to 'fork' a procedure (The whole 'this for 1 frame, that for the next frame' thing) so, to enhance my learning, please explain how this works. |
|
| Author: | CodeMonkey2000 [ Mon Apr 28, 2008 6:48 pm ] |
| Post subject: | RE:moving an animation with keyboard |
You shouldn't have all those nested loops for the animation, since in those loops you aren't checking for input. |
|
| Author: | Insectoid [ Mon Apr 28, 2008 6:56 pm ] |
| Post subject: | RE:moving an animation with keyboard |
Well, to make the animation work, I have to! But I see where your going with this and have an Idea about how to maybe make it work... |
|
| Author: | Insectoid [ Mon Apr 28, 2008 6:57 pm ] |
| Post subject: | RE:moving an animation with keyboard |
wait, never mind! It won't work |
|
| Author: | CodeMonkey2000 [ Mon Apr 28, 2008 7:40 pm ] | ||
| Post subject: | RE:moving an animation with keyboard | ||
Sigh...you should be doing frame by frame animation. remember what pacman looks like at each frame.
|
|||
| Author: | Insectoid [ Mon Apr 28, 2008 7:59 pm ] |
| Post subject: | RE:moving an animation with keyboard |
Yes, well, We haven't been taught boolean yet, and by the way my teacher's going, I'll have to find out for myself. |
|
| Author: | Insectoid [ Mon Apr 28, 2008 8:05 pm ] |
| Post subject: | RE:moving an animation with keyboard |
Found a glitch in your code. After you move Mr. Pacman, The mouth doesn't open smoothly anymore. it's instant. It closes fine, though. |
|
| Author: | CodeMonkey2000 [ Mon Apr 28, 2008 8:13 pm ] |
| Post subject: | RE:moving an animation with keyboard |
Meh I don't really care |
|