Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Halifax on July 12, 2006, 07:05:00 am

Title: [83+ xLIB] Walking sprites with Xlib
Post by: Halifax on July 12, 2006, 07:05:00 am
I was fooling around with Xlib the one day and wanted to make a good four ways walking sprite with the legs moving and all that stuff, but I couldnt. I could not find a fast way to find out the key pressed and then to change the sprite. So I was wondering how you would code a 4-way walknig sprite?
Title: [83+ xLIB] Walking sprites with Xlib
Post by: Zeromus on July 12, 2006, 07:20:00 am
4 way walking sprite? http://cdi.calcgames.org/CalcStuffs/T14.zip is a good example of it, basically, you can have 2 walking, or 2 walking and an idle. The latter being harder. But you just have to change a number (I use the first and 2nd rows so -+1-> (or negative varaible plus one store to variable) works for me) as for the idle, well that is another issue, ask xlibman or kalan_vod XDsmiley.gif seeing how I haven't done an idle sprite in ages
Title: [83+ xLIB] Walking sprites with Xlib
Post by: kalan_vod on July 12, 2006, 09:13:00 am
I dont like doing idle, but for chips if I want to make it orginal....I will have to *gasp*! :Ptongue.gif, but all in all just a regular movement way would be simpler.
QUOTE
:1→A:Ans→B:real(0
:Repeat θ=45
:For(I,1,0,‾1
:real(1,8B-8,8A-8,1,8,0,3,8,3,0,I
:End
:Repeat Ans
:getKey→θ
:End
:B+(Ans=26)-(Ans=24→B
:A+(θ=34)-(θ=25→A
:End

That is using getkey and not real(8 like in xLIB, since you only need four way movement it would be just as easy. If you wanted to do 8 way movement it would be a little bigger, but just as fast. And if you want to make it have hit detection (aka, if you can walk onto a tile or not like a wall tile you would make it look at the matic first before the move). If you want to see how to do the tile test and what not, let us know and someone will post a code snippet. CDIs is great, but it is a little more complicated that just four way movement (using the same sprite).
Title: [83+ xLIB] Walking sprites with Xlib
Post by: Zeromus on July 12, 2006, 09:27:00 am
QuoteBegin-Killerplayer+Jul 12 2006, 01:05 PM-->
QUOTE (Killerplayer @ Jul 12 2006, 01:05 PM)
I was fooling around with Xlib the one day and wanted to make a good four ways walking sprite with the legs moving and all that stuff  

 Umm... @kalan, sorry bud, yours is just moving sprites, not making them "walk" ^^
Title: [83+ xLIB] Walking sprites with Xlib
Post by: kalan_vod on July 12, 2006, 09:32:00 am
QuoteBegin-CDI+Jul 12 2006, 03:27 PM-->
QUOTE (CDI @ Jul 12 2006, 03:27 PM)
QuoteBegin-Killerplayer+Jul 12 2006, 01:05 PM-->
QUOTE (Killerplayer @ Jul 12 2006, 01:05 PM)
I was fooling around with Xlib the one day and wanted to make a good four ways walking sprite with the legs moving and all that stuff

Umm... @kalan, sorry bud, yours is just moving sprites, not making them "walk" ^^  

 Rofl, I misread that totally....Sorry man, at least you have something XDsmiley.gif.
Title: [83+ xLIB] Walking sprites with Xlib
Post by: Halifax on July 12, 2006, 11:51:00 am
Yea thanks for all the help guys seriously. Much appriceiated or however you spell that
Title: [83+ xLIB] Walking sprites with Xlib
Post by: kalan_vod on July 12, 2006, 12:04:00 pm
Np, if you need anymore help let us know.
Title: [83+ xLIB] Walking sprites with Xlib
Post by: DJ Omnimaga on July 12, 2006, 01:04:00 pm
I had lot of problems with walking sprites, it took me a week to get the FFCR (an old RPG that I worked on with drak dragon before he kicks me out for no reason) engine to work properly (the sprite would change direction too late or stuff like that)
Title: [83+ xLIB] Walking sprites with Xlib
Post by: Spellshaper on July 12, 2006, 01:07:00 pm
ah k... when I was still new to the world of wonders xLib holds, I did a moving engine with walking sprites for testing purposes, using the char sprites form The Verdante Forest ^^
Took a while to figure it out and avoid crashing the calc :knight:knight3.gif
Title: [83+ xLIB] Walking sprites with Xlib
Post by: DJ Omnimaga on July 21, 2006, 09:19:00 am
yeah same here, and with codex too, I got lot of ram clear when doing ROL3 (which use CODEX)