View Single Post
Old 26 January 2017, 14:24   #32
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 153
There you go:

Code:
;----------------------------------------

#TILEWIDTH =16
#TILEHEIGHT=16

mapScreenWidth=20
mapScreenHeight=15

mapWidth=40
mapHeight=30

mapStartX=0
mapStartY=0

;----------------------------------------

WBStartup
CloseEd

;NoCli

INCLUDE "tilemap.bb2"

a$="data/map2.bin"
loadBinaryMap{a$}

BitMap 0,320+32,240,4
LoadBitMap 0,"data/tiles1.iff",0

BLITZ
InitCopList 0,44,240,$14,8,16,0
CreateDisplay 0
DisplayPalette 0,0
DisplayBitMap 0,0,16,0

For i=0 To 16
  GetaShape i,i*#TILEWIDTH, 0, #TILEWIDTH, #TILEHEIGHT
Next i

  GetaShape 17,16,16,26,32
MakeCookie 17

Cls


;----------------------------------------

Statement drawTileColumn {x,column}
SHARED tileMap(), mapScreenWidth, mapScreenHeight, mapWidth
i=column : y=0
    Repeat
        t=tileMap(i)
          Block t, x*#TILEWIDTH, y*#TILEHEIGHT
          i=i+mapWidth
          y=y+1
    Until y=mapScreenHeight
End Statement

;----------------------------------------


dx=080 : dy=100
mx=0 : my=0

startX=32

frame=15

While Joyb(0)=0
  VWait
  UnBuffer 0

    dx=dx+Joyx(1)
    dy=dy+Joyy(1)

    DisplayBitMap 0,0,startX+mx,my

    If col <> mapWidth
        If frame=15

          drawTileColumn { QWrap(counter,0,22), col }
          counter=counter+1
          col=col+1
          frame=0
        EndIf

    VWait


        mx=mx+1
        frame=frame+1

    EndIf

Wend

AMIGA
End
carrion is offline  
 
Page generated in 0.04269 seconds with 11 queries