Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: hellninjas on October 21, 2011, 02:29:52 pm

Title: Walking man
Post by: hellninjas 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... *.*
Title: Re: Walking man
Post by: chattahippie 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
Title: Re: Walking man
Post by: hellninjas on October 21, 2011, 02:46:57 pm
I mean the walking man that moves only when you move him with the arrow keys.
Title: Re: Walking man
Post by: chattahippie 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
Title: Re: Walking man
Post by: hellninjas on October 21, 2011, 02:48:07 pm
Thats what im trying to figure out is how to change the sprite when it moves
Title: Re: Walking man
Post by: Eiyeron 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!
Title: Re: Walking man
Post by: hellninjas on October 21, 2011, 02:49:31 pm
Yes i know, but how would i do this?
Title: Re: Walking man
Post by: Eiyeron 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...
Title: Re: Walking man
Post by: hellninjas on October 21, 2011, 02:50:59 pm
counter var?
Title: Re: Walking man
Post by: Eiyeron on October 21, 2011, 02:51:46 pm
a variable who's designed the be the counter ofr designing wich sprite will be used...
Title: Re: Walking man
Post by: hellninjas on October 21, 2011, 02:52:27 pm
Could you give an example please?
Title: Re: Walking man
Post by: chattahippie 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?
Title: Re: Walking man
Post by: Eiyeron 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!
Title: Re: Walking man
Post by: Happybobjr 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.
Title: Re: Walking man
Post by: Eiyeron on October 21, 2011, 03:01:06 pm
Ninja'd, bro!
Title: Re: Walking man
Post by: hellninjas on October 21, 2011, 03:02:40 pm
Thanks this was what I was lookin for!
I dont have word so I write everything in meh binder!
Title: Re: Walking man
Post by: Eiyeron on October 21, 2011, 03:03:03 pm
For the threes?
Title: Re: Walking man
Post by: Yeong on October 21, 2011, 03:06:29 pm
Code: [Select]
[HEX]->Pic1
[HEX]...//Walking Right
[HEX]...//Walking Left

0→S→X→Y→Z //Z is Left/Right stuff S is animation
While 1
Pt-Off(X,Y,Z+8*S+Pic1
!if getKey
0→S
if getKey(3)
0→Z
s+1→S
If s+Num_of_Frame+1:1->S
End

if getKey(2)
8*(Frame of still+Right animation)→Z
s+1→S
If s+Num_of_Frame+1:1->S
End
ClrDraw
EndIf getKey(15)
EDIT: /me is ninja'd badly
Title: Re: Walking man
Post by: saintrunner on October 29, 2011, 09:13:33 pm
still think it would be easier just to make like 2-3 sprites and connect them on a loop to the left and right keys....u press left, sprite changes,moves left, right, change, over...etc etc
Title: Re: Walking man
Post by: Happybobjr on October 29, 2011, 11:06:28 pm
that is what all the examples are telling him to do.