-->
0 Members and 1 Guest are viewing this topic.
.AXTILEMP.Map:[000000000000000000000000→Str1TM[000000000000000000000000 [000000000000000000000000 [000206050000000000000000 [000300040002060500020605 [000300020605000206000004 [000300030004000300000004 [010101010101010101010101 .Tiles:[FFAAFF55FFAAFF55→Pic1TL[0F10204080808080 [8080808080808080[0101010101010101[F008040201010101[FF00000000000000[0000000000000000.Now, we can draw the tilemap!Lbl DMP.Draw MaPFor(A,0,7For(B,0,11If {Str1TL+(A*12)+B}→ΘΘ -1→ΘPt-On(B*8,A*8,Pic1TL+(Θ*8)EndEndEndReturn
.COLLISSNLbl COL.COLlission.Inputs: arg1=X ,arg2=Y ,arg3=dX to check,arg4=dY to check (I’ll explain later) .Since we want it smooth-scrolling, we divide the X and Y value by 8 to get the corresponding tile{Str1TL+(((Y+r2)/8)*12)+((X+r1)/8)}Return
.CHARACTR[187E243C7E3C5A66]→Pic1CHLbl MOV.MOVeIf getKey(2) and (X≠0)X-1→XEndIf getKey(3) and(X≠88)X+1→XEndReturnLbl DCH.Draw CHaracterPt-Off(X,Y,Pic1CH).You can also use Pt-Mask(), but come on, this is a tutorial!Return
.PLATFORM0→X55→YRepeat getKey(15)ClrDrawSub(MOV)Sub(DMP)Sub(DCH)DispGraphEndReturnprgmPLATFTLMprgmPLATCHAR
what I can't do is hit-detection and physics while scrolling. any plans to do those?
..Bottom CollisionIf pxl-test(X+2, Y+16) and ( pxl-test(X+15, Y+16) ) //For 16x16 sprites.Do something if something's underneath itEnd