African RPG: Walking Incorrectly
Author |
Message |
Pearse
|
Posted: Thu Jun 24, 2010 10:03 pm Post subject: African RPG: Walking Incorrectly |
|
|
What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
What is the problem you are having?
<Answer Here>
Describe what you have tried to solve this problem
<Answer Here>
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
<Add your code here>
|
Please specify what version of Turing you are using
<Answer Here>
Description: |
its zipped, includes everything (i hope) |
|
Download |
Filename: |
Pearses Summer Project Zipped.zip |
Filesize: |
2.83 MB |
Downloaded: |
50 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Pearse
|
Posted: Thu Jun 24, 2010 10:05 pm Post subject: Re: African RPG: Walking Incorrectly |
|
|
SORRY i guess it deleted my entire message after I clicked add attachment or something... Heres my message, Ill edit the topic once it allows me to...
second edit: Nevermind, I can't edit a topic that has been replied to I guess. Still getting used to these forums..
What is it you are trying to achieve?
I am trying to make it so that when when click the Left Arrow Key, your 'avatar'(or whatever you want to call him) walks left. I have three different pictures of him moving his feet and arms. It is supposed to be that it shows picture1, picture2 and then picture3, each one moving his legs a little more, creating the effect of walking, all while constantly moving the avatar in the right direction of the screen. I know the animation itself may not be top notch, all I'm trying to accomplish is the correct effect.
What is the problem you are having?
The three pictures I mentioned earlier, draw over themselves. Now, I know one of the reasons why is because a fourth picture, one of him just standing still (idle) is inside the loop, and if I move it outside the loop, he doesn't appear at all (this isn't as important, i think i can figure this one out). Anyways, It shows each picture, but on top of one another, and then it moves, and repeats basically. Also, When trying to use a delay command, it slows him down completely, so I can't really think of how to use delay because this stops the whole program-causing him to move slower as a whole.
Describe what you have tried to solve this problem
I've tried increasing the X-value after each picture so it constantly moves right while using View.Update ().
I've tried using cls after each picture but that just makes the screen go blank, shows him idle, then blank, etc...
So because of that, I tried throwing a bunch of View.Update() between almost every second line to no avail... and so I took out the cls.
I also tried just drawing the picture, increase x value, View.Update(), draw second picture, increase x value, View.Update () and so on...
I've tried so many different things I think I might have started doing the same things over again.
Please specify what version of Turing you are using
Turing 4.1.1
Note:
I'm aware the other commands for KEY_DOWN are too fast, and don't have any walk effect, I can apply myself what you guys teach me to the other directions.
I just started this today, (there's no collision yet) so there's only a few lines of code to look through...
See attached file, it includes the pictures and everything required for you to help me.
OPEN UP 'SummerProj'
Thank you very much.
|
|
|
|
|
|
Cezna
|
Posted: Fri Jun 25, 2010 8:53 am Post subject: RE:African RPG: Walking Incorrectly |
|
|
Don't you want them to draw over themselves (or else it would just show a trail of all of the different phases of his walk)?
Maybe I don't fully understand the problem...
Anyway, you may just want to make the images into a gift using a program like Microsoft PowerPoint and then draw the gif.
If you open Turing's F10 help section, and search for Sprite.Animate, there should be an example program showing a skeleton walking, and the skeleton is a gif, so you can see how to incorporate a gif into your program.
|
|
|
|
|
|
TokenHerbz
|
Posted: Fri Jun 25, 2010 10:41 am Post subject: RE:African RPG: Walking Incorrectly |
|
|
The basic setup to eliminate this is to have all those things in the same loop senario.
try to set it up like the following. You should add a variable for the directions to, so you know which idle position to be drawing when there is no movement.
%%%%%%%%%%%%EXample setup%%%%
code: |
if moving left then
alternate left animations
set direction left
elsif moving right then
alternate right animations
set direction right
elsif down/up same thing
%%%add idle pics to this loop if no moving
elsif pic is left then
draw just idle pic facing left
elsif pic is right then
draw just idle pic facing right
elsif %%same for up/down
end if
|
Should work for ya if you set er' up right, lemmy know how it works out for you!
|
|
|
|
|
|
|
|