Author Topic: xLib Help!  (Read 5055 times)

0 Members and 1 Guest are viewing this topic.

stoner_wall_programs

  • Guest
xLib Help!
« on: November 13, 2006, 03:21:00 pm »
We are revamping our RPG, and we thought about using xLib.  We downloaded it, and when I asked for tutorials on our forums, xlibman referred me to the xLib Guru.  It cleared up a lot of stuff about making tilemaps and sprites, but I was wondering how you would make a program that would entail a character moving around a scrollable map with collision checking, similar to the demo that came with xLib.  I looked at the program, and don't understand most of it.  Please post with code suggestions or help.

~Egan

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
xLib Help!
« Reply #1 on: November 13, 2006, 03:26:00 pm »
Hi, welcome! I did made such a simple program back in the day, I only wish I kept it..I am sure someone would be ever so kind to make such a program for you. Good luck!

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
xLib Help!
« Reply #2 on: November 13, 2006, 03:56:00 pm »
I forget the source code for that demo if you could post it maybe we could explain it to you
There are 10 types of people in this world-- those that can read binary, and those that can't.

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
xLib Help!
« Reply #3 on: November 14, 2006, 03:49:00 am »
will it be top view like final fantasy or platform like? I don't have any top down view anymore either but i could dig up a platform routine if i get some time

stoner_wall_programs

  • Guest
xLib Help!
« Reply #4 on: November 14, 2006, 09:38:00 am »
Here:
c1-->
CODE
ec1AxisOff
FnOff
1->X:1->Y
->S:->T
prgm MAP1
While 1
S+((X-S)=11)(X!=16)-((X-S)=0)(X!=(-54125+)1->S
T+((Y-T)=7)(T!=16)-((Y-T)=0)(Y!=(-54125+)1->T
real(2,0,S,T,16,16,0,12,0,8,0,0,0,0
real(1,8(X-S),8(Y-T),1,8,0,1,0,0,0,1
Getkey->K
If K=45:Return
X+(K=26)(X!=15)-(K=24)(X!=->N
Y+(K=34)(Y!=15)-(K=25)(Y!=->O
If not([A](O+1,N+1
Then
N->X:O->Y
End
End
c2
ec2

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
xLib Help!
« Reply #5 on: November 14, 2006, 10:22:00 am »
QuoteBegin-stoner_wall_programs+14 Nov, 2006, 15:38-->
QUOTE (stoner_wall_programs @ 14 Nov, 2006, 15:38)
Here:
c1-->
CODE
ec1AxisOff
FnOff
1->X:1->Y
->S:->T
prgm MAP1
While 1
S+((X-S)=11)(X!=16)-((X-S)=0)(X!=(-54125+)1->S
T+((Y-T)=7)(T!=16)-((Y-T)=0)(Y!=(-54125+)1->T
real(2,0,S,T,16,16,0,12,0,8,0,0,0,0
real(1,8(X-S),8(Y-T),1,8,0,1,0,0,0,1
Getkey->K
If K=45:Return
X+(K=26)(X!=15)-(K=24)(X!=->N
Y+(K=34)(Y!=15)-(K=25)(Y!=->O
If not([A](O+1,N+1
Then
N->X:O->Y
End
End
c2
ec2  

 Hmm, what you have it as makes it draw the map and then the sprite repeatedly. And I am unsure if you are actually filling all the arguments for the drawmap function. Might have time tonight after work to help more.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
xLib Help!
« Reply #6 on: November 14, 2006, 01:28:00 pm »
I am really seeing no need to have the update x and y stored to n and o because resotring is just wasting some valuable clock cycles also your running the loop with the map and sprite repeatedly being displayed when there is no need if they are not updated so I would redo this loop to only redisplay the map and sprite if the sprite is moved which you should be able to figure out but if not just say so and I will post some code
There are 10 types of people in this world-- those that can read binary, and those that can't.

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
xLib Help!
« Reply #7 on: November 15, 2006, 02:09:00 am »
are you using the xlib version 0.601 from ticalc or Omnimaga? If you are using an older version it may be why there is missing arguments

stoner_wall_programs

  • Guest
xLib Help!
« Reply #8 on: November 15, 2006, 12:05:00 pm »
We have xLib v0.601b from TICalc.org.  By the way, guys, we didn't write that.  That was an example that came with xLib.  I pretty much understand making tilemaps with matrices and stuff, but I need some help with collision checking and moving.  I'm the one that will learn xLib to use in sequels to Quest (Evan's job is learning 2 calc communications for our first release of the game, so any help using GetCalc( would also be appreciated).

~Egan

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
xLib Help!
« Reply #9 on: November 16, 2006, 12:30:00 pm »
GetCalc( is a very simple command

Sending Calc:
Needs to be in either a For( statement or Pause to recieve the information so if you want fast transfering your going to need to be able to snycronize the calc to recieve the info and a little note is that the calc is being forced to send the info by the other calc if it can

Recieveing Calc:
Needs command GetCalc(variable
variable cannot be a program or other stuff. Basically it can only be a list,matrix,equation,string or other variables of that nature if you know what I mean

*note: If you want this game to be able to be used by a TI-84 you need to do GetCalc(-54125+1,variable otherwise it will just natively go to the I/O port so if you do GetCalc(variable then the game will be playable by 83's with 83's and 84's with 83's. If you use GetCalc(-54125+1,variable then the game will be playable to 84's with 84's if you do GetCalc(0,variable then the game will be playable by 83's with 84's and 83's with 83's because 0 specifies using only the I/O port

if you do:
GetCalc(port,variable where prot is a variable that is changed accordingly by settings in the game or something then the game will be playable by 83's with 83's and 83's with 84's and 84's with 84's so all calculators can play with each other no matter what and I think that is what you would want to do instead of maknig 2 seperate versions right ;)wink.gif
There are 10 types of people in this world-- those that can read binary, and those that can't.