Computer Science Canada Animating Characters |
Author: | Tasty Pastry [ Fri Jun 09, 2017 4:35 pm ] | ||
Post subject: | Animating Characters | ||
I'm trying to animate some characters in turing, but I don't know how to animate then only when a key is pressed. For example goes up when the up arrow key is pressed, down when the down arrow key is pressed, etc. I also can't figure out how to stop the character from moving after the key has been depressed. I've got the animation part down, but the rest I can't seem to figure out.
\ |
Author: | Insectoid [ Sat Jun 10, 2017 6:50 am ] |
Post subject: | RE:Animating Characters |
Let me see if I understand what you're going for here. if a key is pressed, then move the character. Does that sound about right? |
Author: | Tasty Pastry [ Sat Jun 10, 2017 11:33 am ] | ||
Post subject: | Re: RE:Animating Characters | ||
Insectoid @ Sat Jun 10, 2017 6:50 am wrote: Let me see if I understand what you're going for here.
if a key is pressed, then move the character. Does that sound about right? Yeah, I did try if statements, but if I put them inside the for loop, the for loop just executes and finishes without key input, and if I put it before the loop, it does work, but it goes through the whole animation sequence instead of stopping after the key is depressed.
|
Author: | Insectoid [ Sat Jun 10, 2017 2:18 pm ] |
Post subject: | RE:Animating Characters |
Why do you think you need a for loop? |
Author: | Tasty Pastry [ Sat Jun 10, 2017 2:54 pm ] |
Post subject: | Re: RE:Animating Characters |
Insectoid @ Sat Jun 10, 2017 2:18 pm wrote: Why do you think you need a for loop?
Because in the animation sequence there are different sprites to use, so I needed that so it can go through all the sprites in the walking animation. |
Author: | Insectoid [ Sat Jun 10, 2017 5:56 pm ] |
Post subject: | RE:Animating Characters |
Are you sure you can't think of another way to do that without a for loop? |
Author: | Tasty Pastry [ Sat Jun 10, 2017 6:52 pm ] |
Post subject: | Re: RE:Animating Characters |
Insectoid @ Sat Jun 10, 2017 5:56 pm wrote: Are you sure you can't think of another way to do that without a for loop?
I don't think I can do that without a for loop. |
Author: | Insectoid [ Sat Jun 10, 2017 7:05 pm ] |
Post subject: | RE:Animating Characters |
You only need the for loop so there's a counter for the gif frames, right? Can you think of another way to make a counter? I mean, it is just a number that increments every loop after all. |