Author Topic: xLib putting sprite in scrolling map  (Read 2530 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
xLib putting sprite in scrolling map
« on: November 30, 2010, 10:09:38 am »
I got the scrolling tilemap to work, but I have no idea how to put sprite and scrolling based on sprite's location.
Help!
Sig wipe!

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: xLib putting sprite in scrolling map
« Reply #1 on: November 30, 2010, 10:14:28 am »
Is your tilemapping working through real(2 and [A]?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: xLib putting sprite in scrolling map
« Reply #2 on: November 30, 2010, 10:24:54 am »
it's [ B ]. but rest of them follows real(2
EDIT: the whole routine containing scrolling tilemap will be thankful since mine is buggy
« Last Edit: November 30, 2010, 10:31:19 am by yeongJIN_COOL »
Sig wipe!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: xLib putting sprite in scrolling map
« Reply #3 on: December 02, 2010, 08:31:23 pm »
Can anyone tell me why it doesn't work?
This is scrolling tilemap/sprite routine that I tried to make with xLib.
Code: [Select]
//L1={Col_Min,Col_Max,Row_Min,Row_Max,Mat_x,Mat_y,X_Coor,Y_Coor}
//Matrix [A] has 16X24 dimension

PrgmA

:Lbl A
:real(2,0,0,0,96,64,L1(1),L1(2),L1(3),L1(4),1,0,8,1
:prgmB
:Goto A


PrgmB
:real(1,L1(7),L1(8),1,8,2,0,L1(9),0,0,1
:0->theta:While theta=0:getKey->theta:End
:real(1,L1(7),L1(8),1,8,2,0,L1(9),0,0,1
:L1(5)+(L1(5)<L1(2) and theta=26)-(L1(5)>L1(1) and theta=24)->A
:L1(6)+(L1(6)<L1(4) and theta=34)-(L1(6)>L1(3) and theta=25)->B
:[A](B,A)->C
:If C<N:Then:A->L1(5):B->L1(4):End //N is the collition detection thingy. basically the tilemap value. the tilemap value smaller than N is passable
:L1(7)+8(theta=26 and C<N and (L1(7)<48 or L1(2)=24) and L1(7)<88)-8(theta=24 and C<N and (L1(7)>40 or L1(1)=0) and L1(7)>8)->L1(7)
:L1(8)+8(theta=34 and C<N and (L1(8)<32 or L1(4)=12) and L1(8)<56)-8(theta=25 and C<N and (L1(8)>24 or L1(3)=0) and L1(8)>8)->L1(8)
:L1(2)+(theta=26 and L1(2)!=24)-(theta=24 and L1(2)!=12)->L1(2
:L1(1)+(theta=26 and L1(1)!=12)-(theta=24 and L1(1)!=0)->L1(1
:L1(4)+(theta=34 and L1(4)!=16)-(theta=25 and L1(4)!=8)->L1(4
:L1(3)+(theta=34 and L1(3)!=8)-(theta=25 and L1(4)!=0)->L1(3
Sig wipe!