Author Topic: Tilemapping Problem  (Read 5192 times)

0 Members and 1 Guest are viewing this topic.

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Tilemapping Problem
« 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



Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Tilemapping Problem
« Reply #1 on: May 16, 2011, 05:40:54 pm »
Try this

Code: [Select]
{I*6+J+GDB1}->A
« Last Edit: May 16, 2011, 05:43:56 pm by squidgetx »

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Tilemapping Problem
« Reply #2 on: May 16, 2011, 05:43:05 pm »
Also, don't forget to close your parenthesis in an axe program. ;)
ld a, 0
ld a, a

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Re: Tilemapping Problem
« Reply #3 on: May 16, 2011, 06:00:30 pm »
Thanks

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Re: Tilemapping Problem
« Reply #4 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?


Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Tilemapping Problem
« Reply #5 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! :)

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Tilemapping Problem
« Reply #6 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.)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: Tilemapping Problem
« Reply #7 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 ;)