Computer Science Canada Walking animation help |
Author: | Monduman11 [ Tue Jun 08, 2010 5:31 pm ] | ||
Post subject: | Walking animation help | ||
What is it you are trying to achieve? i am trying to make my character look as if he is walking instead of just gliding What is the problem you are having? i cant seem to get it to work Describe what you have tried to solve this problem everything i can think of Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) below
Please specify what version of Turing you are using 4.1.1 |
Author: | Cezna [ Tue Jun 08, 2010 5:37 pm ] |
Post subject: | RE:Walking animation help |
The simplest way would be to draw the character at multiple stages of his run, taking pictures of each, and then either draw these pictures sequentially with Turing, or upload them into another program such as Power Point and make a .gif out of it. You can also check this link to another thread in which someone posted a "Mario Movement Test", which does exactly what it sounds like you are trying to do. Link: http://compsci.ca/v3/viewtopic.php?t=24269&highlight=mario |
Author: | Monduman11 [ Tue Jun 08, 2010 5:51 pm ] |
Post subject: | Re: Walking animation help |
ah thank you so much... and btw in your welcome thread i cant reply cause for some reason its set to only mods and admins |
Author: | Cezna [ Tue Jun 08, 2010 5:53 pm ] |
Post subject: | RE:Walking animation help |
Hmmmm.... just mine? Or are all of the welcome threads like that? |
Author: | Monduman11 [ Tue Jun 08, 2010 5:54 pm ] |
Post subject: | Re: Walking animation help |
im not sure cause ive only tried urs.... hold on ill go check ![]() edit: i checked and it seems that everyones is like that... wonder why |
Author: | Cezna [ Tue Jun 08, 2010 5:57 pm ] |
Post subject: | RE:Walking animation help |
They're probably not supposed to develop into full-fledged conversations. Btw, I'm the chat room right now. Feel free to jump in. |
Author: | Monduman11 [ Tue Jun 08, 2010 5:58 pm ] |
Post subject: | Re: Walking animation help |
i would but i cant.. for some reason it gives me an error |
Author: | Monduman11 [ Tue Jun 08, 2010 6:01 pm ] |
Post subject: | Re: Walking animation help |
im attaching a picture so u can see for yourself lol |
Author: | Cezna [ Tue Jun 08, 2010 6:01 pm ] |
Post subject: | RE:Walking animation help |
It's probably filtering it out. Try closing the page, then coming back (I mean close your browser), and then set it to allow "potentially unsafe content" if/when it prompts you I had the same problem, and doing that fixed it. edit : just saw the attachment, I had that EXACT same error message |
Author: | Monduman11 [ Tue Jun 08, 2010 6:11 pm ] | ||
Post subject: | Re: Walking animation help | ||
here it is
|
Author: | Cezna [ Tue Jun 08, 2010 6:16 pm ] |
Post subject: | RE:Walking animation help |
Here's a link to a post that explains why processes are bad. http://compsci.ca/v3/viewtopic.php?t=7842 |
Author: | Monduman11 [ Tue Jun 08, 2010 6:48 pm ] | ||
Post subject: | Re: Walking animation help | ||
Here is the shooting without a process.
I didint really want to use this one cause TerranceN helped me with it when i couldnt figure out how to do it without a process. but yea if you could somehow help id appreciate it |
Author: | Cezna [ Wed Jun 09, 2010 7:12 pm ] |
Post subject: | RE:Walking animation help |
I can't do anything without the picture ![]() |
Author: | Monduman11 [ Wed Jun 09, 2010 7:59 pm ] |
Post subject: | Re: Walking animation help |
lol its the pic in the attachment ![]() |
Author: | Insectoid [ Wed Jun 09, 2010 8:01 pm ] | ||
Post subject: | RE:Walking animation help | ||
@Cezna, You could keep a stock image around for just this type of situation. I find it very helpful. Anyway, what you want is an array of images with the character in different stages of walking. Keep a counter of what image is being used, and then say, if the left arrow key is pressed, increment the counter by 1 and instead of Pic.Draw ("Whatever.bmp"), you'd have Pic.Draw (picArray(counter)). Using a 2d array of left and right images, you can swap which direction the character is facing for left or right movement using a direction variable. For example (a very pseudo-code-y, incomplete example),
You could add an idle pic so if no key is pressed it switches to a default image so he doesn't freeze mid-stride (lawl). |
Author: | Cezna [ Wed Jun 09, 2010 8:10 pm ] |
Post subject: | RE:Walking animation help |
Listen to Insectoid, once again, he has pwned me and hopefully helped you solve your problem ![]() Anyway, ![]() Even though I probably won't be able to improve much on what help Insectoid has given you, I will look through the code regardless with the picture now at my disposal, and if I come up with anything, you'll find it here. |
Author: | Monduman11 [ Wed Jun 09, 2010 8:12 pm ] |
Post subject: | Re: Walking animation help |
ah kk i see what your getting at . thx insectoid ill try it out and see how it goes |
Author: | Monduman11 [ Wed Jun 09, 2010 8:14 pm ] |
Post subject: | Re: RE:Walking animation help |
Cezna @ Wed Jun 09, 2010 8:10 pm wrote: Listen to Insectoid, once again, he has pwned me and hopefully helped you solve your problem
![]() Anyway, ![]() Even though I probably won't be able to improve much on what help Insectoid has given you, I will look through the code regardless with the picture now at my disposal, and if I come up with anything, you'll find it here. kk thx , and insectoid helped with the walking animation not the shooting thing, he just gave me a suggestion on how else i could do it |
Author: | Cezna [ Wed Jun 09, 2010 8:16 pm ] |
Post subject: | RE:Walking animation help |
Dang, was about to post an edit ![]() Here is a link to another topic where there was a discussion on the same stuff Insectoid was talking about: http://compsci.ca/v3/viewtopic.php?t=25497 |
Author: | Monduman11 [ Wed Jun 09, 2010 8:18 pm ] |
Post subject: | Re: Walking animation help |
ah kk thanks again lol |
Author: | Insectoid [ Wed Jun 09, 2010 8:24 pm ] |
Post subject: | RE:Walking animation help |
Shooting is pretty easy to do. Have a flexible array (or just a big enough regular array to hold the maximum number of shots possible on screen at a time) and whenever the 'shoot' button is pressed, add the character's x, y and direction coordinates to the array (either use 3 arrays for the 3 elements or a record if you know how). Then, in your main loop, have a separate loop that moves all the bullets (direction should be either -1 or 1 for ease of use). Keep a counter to control how soon a bullet can be fired off (set it to like, 10 or something and then decrement it every frame and don't let the gun fire unless the counter's less than 0, then set to 10 again). Or use Time.SinceLast or whatever it's called. |
Author: | Monduman11 [ Wed Jun 09, 2010 8:27 pm ] |
Post subject: | Re: RE:Walking animation help |
Insectoid @ Wed Jun 09, 2010 8:24 pm wrote: Shooting is pretty easy to do. Have a flexible array (or just a big enough regular array to hold the maximum number of shots possible on screen at a time) and whenever the 'shoot' button is pressed, add the character's x, y and direction coordinates to the array (either use 3 arrays for the 3 elements or a record if you know how). Then, in your main loop, have a separate loop that moves all the bullets (direction should be either -1 or 1 for ease of use). Keep a counter to control how soon a bullet can be fired off (set it to like, 10 or something and then decrement it every frame and don't let the gun fire unless the counter's less than 0, then set to 10 again). Or use Time.SinceLast or whatever it's called.
i already have the shooting thing and it works seperatly but when i try to add it to the game, whenever i press the shoot button the fireball is shot but it doenst blend in with the game it just shoots leaving a white line behind it |
Author: | Insectoid [ Wed Jun 09, 2010 8:31 pm ] |
Post subject: | RE:Walking animation help |
Does it freeze the rest of your game? |
Author: | Monduman11 [ Wed Jun 09, 2010 8:34 pm ] |
Post subject: | Re: RE:Walking animation help |
Insectoid @ Wed Jun 09, 2010 8:31 pm wrote: Does it freeze the rest of your game?
no once the shooting is done the game continues to work, the only problem im having is that i cant seem to make it be one with the game |
Author: | Insectoid [ Wed Jun 09, 2010 8:40 pm ] | ||||
Post subject: | RE:Walking animation help | ||||
I assume your game looks a bit like this
It really should look more like this
What's happening in yours is when you fire a bullet, the program enters a loop which effectively pauses the program and focuses all its attention on moving that bullet. Rather, the bullet should be moved like a character; only once per loop. Moving two things at the same time is a vital part of animation and learning how will be invaluable. |
Author: | Monduman11 [ Wed Jun 09, 2010 8:42 pm ] |
Post subject: | Re: Walking animation help |
ah kk ill try to edit my code and see if i can make it work ![]() |
Author: | Cezna [ Thu Jun 10, 2010 11:47 am ] |
Post subject: | RE:Walking animation help |
You just need to redraw the background every time you move the fireball to prevent that white line from showing up, and use setscreen ("offscreenonly") |