
-----------------------------------
strike_hawk89
Wed May 25, 2005 10:20 am

Animating a character in a game
-----------------------------------
i need to make a character for a game animate properly while walking. i know i posted something like this b4 but no one gave me a clear answer on how to solve the problem. here is the code i am using now. right now, i does not work properly. i want it so that when u press and hold the arrow key to move the character, the character moves his right leg, and then his left leg, so he looks like he is walking. var x, y : int
x := 100
y := 100
var pic : array 1..2 of int
pic (1) := Pic.FileNew ("ninja1.bmp")
pic (2) := Pic.FileNew ("ninja2.bmp")
var chars : array char of boolean
loop
Input.KeyDown (chars)
 if chars (KEY_RIGHT_ARROW) then
        x := x + 2
Pic.Draw (pic(1), x, y, picMerge)
View.Update
Pic.Draw (pic(2), x, y, picMerge)
View.Update    
end if
 delay (10)
    cls
end loop
thx

-----------------------------------
jamonathin
Wed May 25, 2005 1:34 pm

Re: Animating a character in a game
-----------------------------------
i need to make a character for a game animate properly while walking. i know i posted something like this b4 but no one gave me a clear answer on how to solve the problem. here is the code i am using now. right now, i does not work properly. i want it so that when u press and hold the arrow key to move the character, the character moves his right leg, and then his left leg, so he looks like he is walking. var x, y : int
x := 100
y := 100
var pic : array 1..2 of int
pic (1) := Pic.FileNew ("ninja1.bmp")
pic (2) := Pic.FileNew ("ninja2.bmp")
var chars : array char of boolean
loop
Input.KeyDown (chars)
 if chars (KEY_RIGHT_ARROW) then
        x := x + 2
Pic.Draw (pic(1), x, y, picMerge)
View.Update
delay(10) %HERE 