Author Topic: [TI-BASIC] Help with tile maps  (Read 5078 times)

0 Members and 1 Guest are viewing this topic.

mortalgod

  • Guest
[TI-BASIC] Help with tile maps
« on: December 31, 2005, 05:47:00 pm »
ok heres the deal, i have been programming on my calculator for some time, and recently have decided to make a complex spirite based RPG (kinda why i found this site) and i have the battle enginge done and everyt5hing works fine, but now i wanna actualy make a GAME out of it...

now in order to do that i need to learn how to use tile maps

ive read the xlib 0.3 readme and the section on tilemaps looks like greek to me lol

does anyone know of any tutorials i could read to help me learn how to actualy use tilemaps?

thx for any help at all

tenniskid493

  • Guest
[TI-BASIC] Help with tile maps
« Reply #1 on: December 31, 2005, 05:49:00 pm »
Welcome to the forums.  This is a great place to get help for a RPG.  I don't know of many great tilemap tutorials but a lot of us here know a lot about them so do you have any specific questions you need to ask???  We could go into depth explaining how to use tilemaps but it might just be explaining things you already know.

mortalgod

  • Guest
[TI-BASIC] Help with tile maps
« Reply #2 on: December 31, 2005, 05:56:00 pm »
lol in truth i have never used them and the only thing i know is that its a fast way of drawing lotsa sprites to make RPG worlds out of lol

and thx for the welcome!, i plan to visit lots in the new year, this seems like a realy great community, and those are getting harder and harder to find these days!

tenniskid493

  • Guest
[TI-BASIC] Help with tile maps
« Reply #3 on: December 31, 2005, 06:02:00 pm »
Ok, well I'll start out with the basics.  A tilemap is where you have a map larger than the screen and you only draw a small section of it on the screen.  You need to start out with a picture file that contains the sprites you use in your tilemap.  These sprites need to be 8pxls tall by 8pxls wide.  They need to start in the upper left hand corner and work their way across and then down.  The sprite in the upper left hand corner is sprite 0, the one to the right of it is 1, etc.  You use these numbers to refer to the sprite in a matrix.  This matrix contains the numbers refering to the sprites.  So you define the matrix refering to the sprites and then use the program with the map offsets to draw the tilemap.  If you need help w/ the syntax, ask.

dragon__lance

  • Guest
[TI-BASIC] Help with tile maps
« Reply #4 on: December 31, 2005, 06:05:00 pm »
i'll help too, basically, when making a game, if u have a screen, u don't wanna draw all sprites out with sprite command. Instead, u can use a matrix(2d array) that contains all different sprites, then draw the whole thing on screen at once. How xlib's tilemap works is u specify pic data like sprite, first 8*8 sprite in top left corner in sprite 0, one sprite to the right would be sprite 1, etc...Now in ur matrix, u can put the sprite number in, so when display tilemap, itll display that tile. Hope i make sense :)smile.gif
as for tutorials, this is kinda weird, but reading Kevin's (xlibmans) grayscale tutorial helped me understand tilemaps a little, so try that out.

mortalgod

  • Guest
[TI-BASIC] Help with tile maps
« Reply #5 on: December 31, 2005, 06:06:00 pm »
wow that seems a lot simpler then i thought, il try some tests out and see how i do :Dbiggrin.gif

thx

dysfunction

  • Guest
[TI-BASIC] Help with tile maps
« Reply #6 on: January 01, 2006, 05:21:00 am »
Before xlib, if you wanted to draw a tilemap with a matrix, you had to do something like this:

[code]
For(B,1,matrix_height
For(A,1,matrix_width
If [A](B,A) /= 0
draw_sprite_number_[A](B,A)
End
End

But xlib does this automatically, in less than a second, where before it would take several seconds just to draw one screen. So  to get an idea of what numbers to put in your matrix, you should have a picture containing all your sprites. The first row is sprites -12, from left to right. The next row has 12-23, then it goes on like that, until you hit sprite 95 in the bottom right corner. Each of these sprites must be 8x8 (though a new version of xLib is coming out soon that also supports tilemaps with 16x16 sprites- for now, just use multiple 8x8 sprites to make one 16x16 sprite).

tenniskid493

  • Guest
[TI-BASIC] Help with tile maps
« Reply #7 on: January 01, 2006, 06:21:00 am »
If you need any more help, just ask.  Also, feel free to release your project in the projects and ideas forum.

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
[TI-BASIC] Help with tile maps
« Reply #8 on: January 03, 2006, 08:00:00 pm »
In case you need a little more help here it is:

Basiclly you have a matrix
c1-->
CODE
ec1
[[1,1,1,1,1,1,1,1,1,1,1,1]
 [1,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,1]
 [1,1,1,1,1,1,1,1,1,1,1,1]]->[A]c2
ec2

so on pic 0 the first 8x8(8 pixels by 8 pixels) spirte is a blank white square, and the second 8x8( starts at pixel 8,0) is a black square.
c1
-->
CODE
ec1
real(2,0,0,0,12,8,0,12,0,8,0,0,1;matches up matrix [A] with pic 0 and draws the tile mapc2

Offline Spellshaper

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1690
  • Rating: +0/-0
  • This is me. Or maybe not.
    • View Profile
[TI-BASIC] Help with tile maps
« Reply #9 on: January 04, 2006, 08:00:00 am »
1. welcome to the froums!
2. As already said, we