Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: collechess on May 16, 2011, 05:34:31 pm

Title: Tilemapping Problem
Post by: collechess on May 16, 2011, 05:34:31 pm
I'm making an 12x8 tilemap in Axe for a game.
How come this doesn't work?
Code: [Select]
.T
[0000000000000000->Pic0
[FFFFFFFFFFFFFFFF
[111111111111->GDB1
[100000000001
[100000000001
[100000000001
[100000000001
[100000000001
[100000000001
[111111111111
Repeat getKey(15)
For(I,0,8
For(J,0,6
{I*4+J+GDB1}->A
Pt-On(J*16,I*8,A/16*8+Pic0
Pt-On(J*16+8,I*8,A^16*8+Pic0
End
End
DispGraph
End


Title: Re: Tilemapping Problem
Post by: squidgetx on May 16, 2011, 05:40:54 pm
Try this

Code: [Select]
{I*6+J+GDB1}->A
Title: Re: Tilemapping Problem
Post by: ralphdspam on May 16, 2011, 05:43:05 pm
Also, don't forget to close your parenthesis in an axe program. ;)
Title: Re: Tilemapping Problem
Post by: collechess on May 16, 2011, 06:00:30 pm
Thanks
Title: Re: Tilemapping Problem
Post by: collechess on May 18, 2011, 09:45:03 pm
How about an 8x8 tilemap?
Code: [Select]
.T
[0000000000000000->Pic0
[FFFFFFFFFFFFFFFF
[11111111->GDB1
[10000001
[10000001
[10000001
[10000001
[10000001
[10000001
[11111111
Repeat getKey(15)
For(I,0,8
For(J,0,4
{I*4+J+GDB1}->A
Pt-On(J*16,I*8,A/16*8+Pic0
Pt-On(J*16+8,I*8,A^16*8+Pic0
End
End
DispGraph
End
And why do you have to change the {I*4+J+GDB1}->A?

Title: Re: Tilemapping Problem
Post by: ztrumpet on May 18, 2011, 09:53:06 pm
And why do you have to change the {I*4+J+GDB1}->A?
Because with the map data you provided you have 6 columns instead of 4. ;)

As for the "8*8 tilemap," you actually have only a 4*8 tilemap, because of how Axe stores hex.  Basically, it's reading the lines like this '12','34','56','78' instead of '1','2','3','4','5','6','7','8'.  The way to fix this is to go with [0102030405060708] instead of [12345678].
Good luck! :)
Title: Re: Tilemapping Problem
Post by: yunhua98 on May 19, 2011, 12:36:05 pm
using SirCmpwn's method, which he is using, that's the way it is.  Builderboy found out a hackish way in Axe for Nibbles, so he's got that part right.  (ofc, it may not work since that was in the early versions of Axe.)
Title: Re: Tilemapping Problem
Post by: turiqwalrus on May 20, 2011, 08:11:23 am
using SirCmpwn's method, which he is using, that's the way it is.  Builderboy found out a hackish way in Axe for Nibbles, so he's got that part right.  (ofc, it may not work since that was in the early versions of Axe.)
Builderboy's method still works. after all, he's using simple math to figure out the 2 nibbles ;)