Author Topic: [83+ xLIB] Walking sprites with Xlib  (Read 3273 times)

0 Members and 1 Guest are viewing this topic.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ xLIB] Walking sprites with Xlib
« 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?
There are 10 types of people in this world-- those that can read binary, and those that can't.

Zeromus

  • Guest
[83+ xLIB] Walking sprites with Xlib
« Reply #1 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

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
[83+ xLIB] Walking sprites with Xlib
« Reply #2 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).

Zeromus

  • Guest
[83+ xLIB] Walking sprites with Xlib
« Reply #3 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" ^^

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
[83+ xLIB] Walking sprites with Xlib
« Reply #4 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.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ xLIB] Walking sprites with Xlib
« Reply #5 on: July 12, 2006, 11:51:00 am »
Yea thanks for all the help guys seriously. Much appriceiated or however you spell that
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
[83+ xLIB] Walking sprites with Xlib
« Reply #6 on: July 12, 2006, 12:04:00 pm »
Np, if you need anymore help let us know.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
[83+ xLIB] Walking sprites with Xlib
« Reply #7 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)

Offline Spellshaper

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1690
  • Rating: +0/-0
  • This is me. Or maybe not.
    • View Profile
[83+ xLIB] Walking sprites with Xlib
« Reply #8 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

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
[83+ xLIB] Walking sprites with Xlib
« Reply #9 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)