
-----------------------------------
adam_abm
Thu Jun 05, 2003 10:42 pm

Character walking effect for side-scroller
-----------------------------------
hey 
i'm making a side scroller and wondered if anybody could help me out on how to alternate the pics to give a walking effect while using the Input.Keydown method of character control.

thanks for the help

-----------------------------------
Martin
Thu Jun 05, 2003 11:00 pm


-----------------------------------
Here it is, you can simplify them with arrays if you want.

var pic1 := Pic.FileNew ("step1.bmp")
var pic2 := Pic.FileNew ("step2.bmp")
var pic3 := Pic.FileNew ("step3.bmp")
var pic4 := Pic.FileNew ("step4.bmp")

var x : int := 50
var step := 1 %What step the player is at
var ch : string(1)
loop
    getch(ch)
    if ch = KEY_RIGHT_ARROW then
        if step = 1 then
            Pic.Draw (pic1, x, 100, picCopy)
         elsif step = 2 then
            Pic.Draw (pic2, x, 100, picCopy)
         elsif step = 3 then
            Pic.Draw (pic3, x, 100, picCopy)
         elsif step = 4 then
            Pic.Draw (pic4, x, 100, picCopy)
         end if
         step := step + 1
         x := x + 10
         if step = 5 then
             step := 1
         end if
    end if
end loop

-----------------------------------
adam_abm
Fri Jun 06, 2003 10:29 pm


-----------------------------------
Thanks for the code but i'm using the Input.KeyDown command and if i use your way the guy just contantly flashes through the steps (because theres no getch)  I know theres a way to do it using the Input.KeyDown command so post if you got time and know the way.

thanks

-----------------------------------
Mephi
Fri Jun 06, 2003 10:47 pm


-----------------------------------
just building on the other code:
var pic1 := Pic.FileNew ("step1.bmp") 
var pic2 := Pic.FileNew ("step2.bmp") 
var pic3 := Pic.FileNew ("step3.bmp") 
var pic4 := Pic.FileNew ("step4.bmp") 

var x : int := 50 
var step := 1 %What step the player is at 
var ch : array char of boolean
loop 
    Input.KeyDown (ch)
    if ch (KEY_RIGHT_ARROW) then 
        if step = 1 then 
            Pic.Draw (pic1, x, 100, picCopy) 
         elsif step = 2 then 
            Pic.Draw (pic2, x, 100, picCopy) 
         elsif step = 3 then 
            Pic.Draw (pic3, x, 100, picCopy) 
         elsif step = 4 then 
            Pic.Draw (pic4, x, 100, picCopy) 
         end if 
         step := step + 1 
         x := x + 10 
         if step = 5 then 
             step := 1 
         end if 
    end if 
end loop


basically the same thing, just change to input.keydown

-----------------------------------
JayLo
Tue Jun 17, 2003 5:48 pm


-----------------------------------
oh man. lol according to the turing manual, GIFs should be in Turing, which would render most of this useless.

-----------------------------------
Andy
Tue Jun 17, 2003 6:06 pm


-----------------------------------
according to the turing manual, sprites work and its the best language and that tom west is a genius

-----------------------------------
JayLo
Tue Jun 17, 2003 6:06 pm


-----------------------------------
according to the turing manual, it's a party!

-----------------------------------
Andy
Tue Jun 17, 2003 6:06 pm


-----------------------------------
but ya if GIF works in turing, i'd be awsome cause then you can import animated pics

-----------------------------------
JayLo
Tue Jun 17, 2003 6:08 pm


-----------------------------------
well. tom west SAYS june 2003, but it's prolly not likely.

-----------------------------------
Andy
Tue Jun 17, 2003 6:12 pm


-----------------------------------
tom west is a big fag, lazy bum

-----------------------------------
JayLo
Tue Jun 17, 2003 6:35 pm


-----------------------------------
agreed, but 'beggars can't be choosers'.

-----------------------------------
Andy
Wed Jun 18, 2003 10:33 am


-----------------------------------
lol true, if you complain to him about how crap turing is he doesn't reply, but if you report a bug he replys right away asking how he can recreate the bug

-----------------------------------
PaddyLong
Wed Jun 18, 2003 11:57 am


-----------------------------------
probably because it is more important to make what you have now working entirely than making turing better as a whole as you seem so bent on doing... really turing isn't meant to make retail programs or anything, just for learning.  if you want a better language, learn something like C++ or Java.  but please stop whining about how bad turing is or whatever it is you think is wrong with it.  it does what it was created to do just fine.

-----------------------------------
JayLo
Wed Jun 18, 2003 1:25 pm


-----------------------------------
i guess. okay paddy. challenge accepted.

-----------------------------------
Andy
Wed Jun 18, 2003 3:06 pm


-----------------------------------
wha? what challange? what's going on? is it me or is anyone else confused?

-----------------------------------
JayLo
Wed Jun 18, 2003 3:52 pm


-----------------------------------
the challenge to get out of the turing 'rut' and move on.

-----------------------------------
PaddyLong
Wed Jun 18, 2003 6:00 pm


-----------------------------------
it's not that I'm challenging you to stop using turing, just asking you (not necesarily you Jay Lo, but people in general..) to stop whining about it

-----------------------------------
JayLo
Wed Jun 18, 2003 6:01 pm


-----------------------------------
ya, but you're right. i'm so addicted to turing syntax...

-----------------------------------
Andy
Wed Jun 18, 2003 6:10 pm


-----------------------------------
lol ya i wrote so many compsci tests, i for got how to write the multiplication sign, i keep on writing astricks on my science tests

-----------------------------------
PaddyLong
Wed Jun 18, 2003 6:17 pm


-----------------------------------
I just use a dot for when I'm writing multiplication... x's can get confusing when you're working with variable x

-----------------------------------
Andy
Wed Jun 18, 2003 6:18 pm


-----------------------------------
but its sceince, not math, and science teachers like to use X and plus there are plenty of other variables to use

-----------------------------------
PaddyLong
Wed Jun 18, 2003 6:23 pm


-----------------------------------
x is a pretty standard one, especially when talking about graphs

-----------------------------------
JayLo
Wed Jun 18, 2003 6:24 pm


-----------------------------------
x, y, a, b
that's all i ever hope to use.

-----------------------------------
Andy
Wed Jun 18, 2003 6:32 pm


-----------------------------------
what about theta and alpha for angles?

-----------------------------------
PaddyLong
Wed Jun 18, 2003 6:34 pm


-----------------------------------
and z, i, j, k for vectors and 3 space

-----------------------------------
Andy
Wed Jun 18, 2003 6:35 pm


-----------------------------------
3 spaces wha?

-----------------------------------
PaddyLong
Wed Jun 18, 2003 6:38 pm


-----------------------------------
3d plane, x, y, z (you're probably used to 2 space, x, y)
i, j, k are unit vectors for planes x,y,z respectively... in algeo you don't look at points in a plane as just points, you look at them as vectors...
so like point (x, y, z) is actually a linear combination of vectors i, j, k so it is actually vector OP = xi + yj + zk

-----------------------------------
Andy
Wed Jun 18, 2003 6:39 pm


-----------------------------------
o u know i'm not a moron, i didn't know what u meant about 3 spaces, i thought  u were talking about  "   "

-----------------------------------
Mephi
Wed Jun 18, 2003 6:43 pm


-----------------------------------
isnt that just one space? three spaces is more like this: "   "

-----------------------------------
PaddyLong
Wed Jun 18, 2003 6:52 pm


-----------------------------------
lol, html doesn't display extra spaces unless you use & nbsp;  "&nbsp;&nbsp;&nbsp;"

-----------------------------------
krishon
Thu Jun 19, 2003 9:51 am


-----------------------------------
ye...that's true, its so stupid, i dun't y they made it like that
