Author Topic: Walking man  (Read 9479 times)

0 Members and 1 Guest are viewing this topic.

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Walking man
« on: October 21, 2011, 02:29:52 pm »
How would I make the walking man sprite that I see in tag and portal? And or... How would I animate a sprite?
I really want to make the walking man though... *.*

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Walking man
« Reply #1 on: October 21, 2011, 02:45:56 pm »
I know one way is to make a sprite for each frame of his animation, then play them out one at a time over and over... That's going to be the easiest way, if I'm not mistaken

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Walking man
« Reply #2 on: October 21, 2011, 02:46:57 pm »
I mean the walking man that moves only when you move him with the arrow keys.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Walking man
« Reply #3 on: October 21, 2011, 02:47:31 pm »
You can check to see if a button is pressed, and only roll the sprites while they are pressed

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Walking man
« Reply #4 on: October 21, 2011, 02:48:07 pm »
Thats what im trying to figure out is how to change the sprite when it moves

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Walking man
« Reply #5 on: October 21, 2011, 02:48:50 pm »
Tip: In sonic games, the "roll speed" is function from speed of sonic, more sonic is faster, more his legs will turn!

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Walking man
« Reply #6 on: October 21, 2011, 02:49:31 pm »
Yes i know, but how would i do this?

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Walking man
« Reply #7 on: October 21, 2011, 02:50:26 pm »
make a counter var, and adds it for example x speed, and if 0<counter<blah then pic 1, or if blah+1<counteur<blah.2...

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Walking man
« Reply #8 on: October 21, 2011, 02:50:59 pm »
counter var?

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Walking man
« Reply #9 on: October 21, 2011, 02:51:46 pm »
a variable who's designed the be the counter ofr designing wich sprite will be used...

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Walking man
« Reply #10 on: October 21, 2011, 02:52:27 pm »
Could you give an example please?

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Walking man
« Reply #11 on: October 21, 2011, 02:54:11 pm »
Something like:

Code: [Select]
[sprite1]->Pic1
[sprite2]
[sprite3]
[sprite4]
0->S  //Will use for animation purposes (frame number)
Repeat getKey(15)
If getKey
S++   //If a key is pressed, it will add one to the animation frame
(S=4)*65532->S  //If S = 4, it will subtract 4 (65532 should equal -4)
End
Pt-On(0,0,S*8+Pic1) //Will display one frame of the animation, and frames are 8 bytes each
DispGraph
ClrDraw
End
Is that what you need?

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Walking man
« Reply #12 on: October 21, 2011, 02:54:16 pm »
aww i never did that, but (% = modulo)
counteur += (speed.x)%count_max
if(0<counter<100)
 draw(spr1)
elseif(100<counteur<200)
 draw(spr2)
... and so on

It's what I think about sprite function to speed

Ninja'd!
« Last Edit: October 21, 2011, 02:54:50 pm by Eiyeron »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Walking man
« Reply #13 on: October 21, 2011, 02:59:46 pm »
a variable that is used for counting :P
In general only goes in one direction.

a walking man is very easy (to those who can draw (I can't))

Example...
Code: [Select]
[picture still]->PIC1
[pictures left]->PIC2
[]
[]
[]
[pictures right]->PIC3
[]
[]
[]
0->A


getkey(3)-getkey(2)->D+X->X
.......
!If D+1
Pt-On(X ,Y ,A-D^4->A + PIC2)
else!If +1
0->!
Pt-On(X ,Y , Pic1)
else!If +1
Pt-On(X, Y, A+D^4->A + Pic3)
End

This one is really easy to modify and allows for both left and right direction with ease.
« Last Edit: October 21, 2011, 03:02:12 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Walking man
« Reply #14 on: October 21, 2011, 03:01:06 pm »
Ninja'd, bro!