### Author Topic: Tile mapping tutorial? for axe?  (Read 9929 times)

0 Members and 1 Guest are viewing this topic.

#### saintrunner

• Custom Spriter: You ask it! I'll Make it!
• LV10 31337 u53r (Next: 2000)
• Posts: 1787
• Rating: +115/-11
• Flogging Molly
##### Re: Tile mapping tutorial? for axe?
« Reply #15 on: November 19, 2011, 03:00:40 pm »
Thanks that helps! can someone also explain movement with tile mapping? like if I have a character I want to be able to move? I would assume it would be similar to the regular getkey stuff

GAMES:
Spoiler For Spoiler:

#### shmibs

• しらす丼
• LV11 Super Veteran (Next: 3000)
• Posts: 2132
• Rating: +281/-3
• try to be ok, ok?
##### Re: Tile mapping tutorial? for axe?
« Reply #16 on: November 19, 2011, 03:01:56 pm »
i'm working on it already, actually, and will edit it in here.

EDIT:
The main restriction of our last map drawing style is that it doesn't allow drawing different spots in a tile map larger that 12*8, but rather only draws a single screen. here is a simple example that uses bytes for map data (because usually people have more that 16 tiles) and allows the map to be scrolled with getkey.

Code: [Select]
[HEXCODE]->Pic1[MapDataInBytes]->GDB10->A->B //A and B are the x and y coordinates in the tilemap.<map's width in tiles, minus 12>->X<map's height in tiles, minus 8>->YRepeat getkey(15) //repeat until Clear is pressedif getkey(3) //if right keyA<X+A->A //A is increased by the value of (A<X) which can either be 1 or 0, meaning that A will be incremented unless it equals Xendif getkey(2) //if left keyA-(A>X)->A //similar to the last lineendif getkey(4) //if up keyB<Y+B->Bendif getkey(1) //if down keyB-(B>Y)->BendFor(M,0,7)For(L,0,11)PtOff(L*8,M*8,{B+M*X+A+L+GDB1}*8+Pic1)endend/*/This is a fun section to describe. L*8 and M*8 should be fairly obvious in the first and second arguments./B+M*X is, because of Axe's lack of order of operations, interpreted as (B+M)*X. This will give the Y coordinate/in the map data to read, because in order to find Y coordinates in a single dimensional list, one has to/multiply that value by the total width of the map. A+L then gives the X coordinate, and adding GDB1 makes it point to/the tile map data.*/end
« Last Edit: November 19, 2011, 03:27:01 pm by shmibs »

#### saintrunner

• Custom Spriter: You ask it! I'll Make it!
• LV10 31337 u53r (Next: 2000)
• Posts: 1787
• Rating: +115/-11
• Flogging Molly
##### Re: Tile mapping tutorial? for axe?
« Reply #17 on: November 19, 2011, 03:06:02 pm »
thanks!