Author Topic: Axe tile mapping! HELP!  (Read 27548 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #90 on: December 06, 2011, 03:31:55 pm »
I do not have time to explain this in-depth, but what I always do (it's been a long time since I created a scrolling tilemapper) is like this:
Code: [Select]
(big tilemap here)->GDB1

now display the tilemap from [scrolled X] to [scrolled X]+(96/tile size).
Same for Y.
So if X was the amount scrolled for only horizontal scrolling,i
I'm going to guess what I interpreted
Repeat getkey(15)
For(B,0,8
For(A,X,X+12
{B*13+A+GDB1}->T
If T
T--
Pt-On(A-X*8,B*8,T*8+Pic1
End
End
End
DispgraphClrdraw
End

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #91 on: December 09, 2011, 03:56:47 pm »
*cough*

How does scrolling work then?

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #92 on: December 10, 2011, 07:41:59 pm »
With scrolling, you need an X offset and a Y offset, in pixels. I use T for the X offset, and S for the Y offset. Assuming you have a pointer to the tilemap in W and the start of the Tile sprites in Pic1, using A, B, C, D, and E as temporary variables...

Code: [Select]
ClrDraw

0-(T^8)->C
For(A,T/8-1,T/8+11
0-(S^8)->D
For(B,S/8-1,S/8+11

If {B*WIDTH_OF_MAP+A+W}->E
Pt-On(C,D,E-1*8+Pic1
End

D+8->D
End
C+8->C
End

Dispgraph

So when T is 8 and S is 8, you're at the top-left most corner of the tilemap. You can increment/decrement T and S using the arrow keys.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #93 on: December 10, 2011, 08:41:46 pm »
* epic7 sees why parser loves butts (in a manly way) :thumbsup:

Pointer for the tilemap? You mean like doing
GDB1->W
or something?
« Last Edit: December 10, 2011, 08:41:57 pm by epic7 »

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #94 on: December 10, 2011, 11:15:18 pm »
lol yeah, that's correct, assuming your map data is in GDB1.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Axe tile mapping! HELP!
« Reply #95 on: December 12, 2011, 07:12:39 am »
^^ That. The map itself is not shifted.
I'm not a nerd but I pretend:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #96 on: December 14, 2011, 04:33:48 pm »
Changing S and T by 1 increments by 1 pixel at a time, right?

And width of map in tiles?
« Last Edit: December 14, 2011, 04:42:05 pm by epic7 »

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #97 on: December 15, 2011, 09:29:58 am »
Changing S and T by 1 increments by 1 pixel at a time, right?

Yeah, that's right. And "width of map in tiles" means you enter the number of columns your entire map has.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #98 on: December 16, 2011, 09:44:20 pm »
Does
0-(S^8)->D
Have to be inside the loop?

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe tile mapping! HELP!
« Reply #99 on: December 16, 2011, 09:47:26 pm »
If it is storing something to a variable then no, unless it only happens if something in the loop causes it, in which case you could use lbls
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #100 on: December 16, 2011, 09:49:34 pm »
I'm not sure if it could be out of the loop to optimize, but it seems like it could...

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe tile mapping! HELP!
« Reply #101 on: December 16, 2011, 09:51:27 pm »
It wouldn't do much, but it helps I guess. are you doing this for speed or size?
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #102 on: December 16, 2011, 09:52:50 pm »
Speed. I only have 6mhz.

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe tile mapping! HELP!
« Reply #103 on: December 16, 2011, 09:58:42 pm »
ok then, what I usually do is put my variables and lines and hex's outside of the main loop (as far as tile maps, if you are scrolling I don't know where you put them) so you could experiment with moving those out if you haven't already.
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe tile mapping! HELP!
« Reply #104 on: December 16, 2011, 10:07:15 pm »
Yeah, I know that, but I just wanted to try to move one line in a for loop out of the for loop, and see if it works.

It seems like it has to be in the loop though.