Author |
Message |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sat Jun 12, 2010 1:14 pm Post subject: Movement Help 2 |
|
|
What is it you are trying to achieve?
i am here yet again looking for help to make my character move with animations. i have tried every suggestion that i have found on this site to make him appear like he is running but the majority are with the sprite animate and the ones that i found that werent didint help me at all.
What is the problem you are having?
i would greatly appreciate it if someone could help me with making him look like he is running.
Describe what you have tried to solve this problem
looked all over the forums, asked friends and nothing worked.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
below... i am also trying to make him look like walking without using the sprite animate command
Turing: |
%This is the running pics of him facing left and right
var walk : array 1 .. 10 of int
walk (1) := Pic.FileNew ("walking1.jpg")
walk (2) := Pic.FileNew ("walking2.jpg")
walk (3) := Pic.FileNew ("walking3.jpg")
walk (4) := Pic.FileNew ("walking4.jpg")
walk (5) := Pic.FileNew ("walking5.jpg")
walk (6) := Pic.Mirror (walk (1))
walk (7) := Pic.Mirror (walk (2))
walk (8) := Pic.Mirror (walk (3))
walk (9) := Pic.Mirror (walk (4))
walk (10) := Pic.Mirror (walk (5))
%This is the walking animation Procedure
if chars (KEY_LEFT_ARROW) and whatdotcolour (posx - 10, posy + 24) not= black then % if the left arrow key is pressed and the colour that it touches is not black then it does the rest of the code
sprite := pic1 %shows the character facing left
z := z + 17 % scrolls the screen towards the left
elsif chars (KEY_RIGHT_ARROW) and whatdotcolour (posx + 10, posy + 24) not= black then %same as above
sprite := pic % shows the character facing right
z := z - 17 % scrolls the screen towards the right
else % if no movement is done
velx := 0 % then the character stays still and the velx is equal to 0
end if % ends the if statement
|
Please specify what version of Turing you are using
4.1.1... i will be attaching the pics below if anyone wants to try it out.
Description: |
the pics are in here... the globox1 is the idle pic |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
New Folder.rar |
Filesize: |
9.01 KB |
Downloaded: |
56 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sat Jun 12, 2010 1:30 pm Post subject: RE:Movement Help 2 |
|
|
if anyone would like to contact me to see the whole game so they can try it out my email is cristian_nanu@hotmail.com
|
|
|
|
|
![](images/spacer.gif) |
Cezna
![](http://compsci.ca/v3/uploads/user_avatars/9406831824c097251d4bb4.gif)
|
Posted: Sat Jun 12, 2010 1:47 pm Post subject: RE:Movement Help 2 |
|
|
Your missing a whole bunch of variable declarations, and I can't get it to work.
|
|
|
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sat Jun 12, 2010 1:48 pm Post subject: Re: RE:Movement Help 2 |
|
|
Cezna @ Sat Jun 12, 2010 1:47 pm wrote: Your missing a whole bunch of variable declarations, and I can't get it to work.
add my msn and ill send u the whole game so its way easier.. or if u want ill just pm u it
|
|
|
|
|
![](images/spacer.gif) |
Cezna
![](http://compsci.ca/v3/uploads/user_avatars/9406831824c097251d4bb4.gif)
|
Posted: Sat Jun 12, 2010 2:00 pm Post subject: RE:Movement Help 2 |
|
|
I don't use msn, so you should pm it to me, if you can.
|
|
|
|
|
![](images/spacer.gif) |
USEC_OFFICER
![](http://compsci.ca/v3/uploads/user_avatars/16624966004bb548179e82e.png)
|
Posted: Sat Jun 12, 2010 2:03 pm Post subject: RE:Movement Help 2 |
|
|
You know you could upload the game? (Or does it take a long time for you too?)
|
|
|
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sat Jun 12, 2010 2:17 pm Post subject: Re: RE:Movement Help 2 |
|
|
USEC_OFFICER @ Sat Jun 12, 2010 2:03 pm wrote: You know you could upload the game? (Or does it take a long time for you too?)
i can upload.. i just didint want to do that incase my teacher saw it and said i copied it from this site... but w/e ill upload it and if she asks ill just show her its my account
|
|
|
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sat Jun 12, 2010 2:21 pm Post subject: Re: Movement Help 2 |
|
|
here it is ... hopefully it doesnt take forever
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
Testing.rar |
Filesize: |
4.27 MB |
Downloaded: |
62 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
USEC_OFFICER
![](http://compsci.ca/v3/uploads/user_avatars/16624966004bb548179e82e.png)
|
Posted: Sat Jun 12, 2010 4:23 pm Post subject: RE:Movement Help 2 |
|
|
Thank you.
|
|
|
|
|
![](images/spacer.gif) |
Cezna
![](http://compsci.ca/v3/uploads/user_avatars/9406831824c097251d4bb4.gif)
|
Posted: Sun Jun 13, 2010 9:06 am Post subject: Re: Movement Help 2 |
|
|
In place of this section of code that takes you away from the title:
I would recommend using something like this:
exit when hasch will exit the loop when any key is pressed, instead of just enter.
Also, when I die, I don't respawn
EDIT: I see that you used a skin for the level which is drawn overtop of a skeleton picture (the black and yellow part)
Very clever
I have used this for one of my games that I am in the process of making.
The only thing is that if you use whatdotcolour collision detection, you get problems like the character going into stuff (even though he is pushed back out).
One thing you might want to do to avoid this is have a for loop that is from 1 to velocity, and moves the character 1 space per loop, checking for collisions after every one pixel movement.
The only thing is that this can be a little laggy if the program is already doing a lot, but it is the only way I know of to have accurate collision detection in Turing without hard coding all of the boundaries.
|
|
|
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sun Jun 13, 2010 9:39 am Post subject: Re: Movement Help 2 |
|
|
kk lol ill fix the lagging thing and the enter thing as well. ill be working on adding a play again thing today
edit: ah i just reread ur post and as for the laggy thing if i do the for loop i can fix that becasue at the bottom of the game after the drawing is done i have a delay of 50 and without it the game runs super fast , so all i have to do is lower that and it should run fine check it out if u want put the delay to 0 and see how fast it runs
|
|
|
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sun Jun 13, 2010 12:40 pm Post subject: RE:Movement Help 2 |
|
|
hey i added a death screen and the win screen and you can play again if you die or win... only problem is for some reason the death screen keeps on flickering
|
|
|
|
|
![](images/spacer.gif) |
USEC_OFFICER
![](http://compsci.ca/v3/uploads/user_avatars/16624966004bb548179e82e.png)
|
Posted: Sun Jun 13, 2010 3:00 pm Post subject: RE:Movement Help 2 |
|
|
View.Update?
|
|
|
|
|
![](images/spacer.gif) |
Cezna
![](http://compsci.ca/v3/uploads/user_avatars/9406831824c097251d4bb4.gif)
|
Posted: Sun Jun 13, 2010 3:14 pm Post subject: RE:Movement Help 2 |
|
|
You probably only need to draw the win/lose screen once (I say probably because I don't know the exact situation), and you are probably drawing within the loop that you are using to get an input.
If I am right about that, try taking the drawing and any cls or View.Update calls you may have out of the loop and do all that before the loop, and then just have the input getting actions inside the loop.
If I am wrong about the loop, you will need to refer me to the section of the code in question.
|
|
|
|
|
![](images/spacer.gif) |
Monduman11
![](http://compsci.ca/v3/uploads/user_avatars/1960741284bee0b481d3b8.jpg)
|
Posted: Sun Jun 13, 2010 4:21 pm Post subject: Re: Movement Help 2 |
|
|
i sent u a pm with the updated stuff.. if ur missing anything plz let me know
@ Usec_officer i tried View.Update and it doesnt seem to work
|
|
|
|
|
![](images/spacer.gif) |
|