Kartat : funktiot

MAPHEIGHT


   KUVAUS

Kertoo ladatun kartan korkeuden tileinä. Jos haluat tietää korkeuden pikseleissä, kokeile komentoa ObjectSizeY.

Palautettu luku on kokonaisluku.

   KÄYTTÖ
MAPHEIGHT ()

Katso myös: MAPWIDTH, OBJECTSIZEY

   ESIMERKKI
FrameLimit 40 'limit game performance

'Load map and animate it
map= LoadMap("Media\cdm2.til","Media\tileset.bmp")

AddText "Scanning map..."
DrawScreen

i=0
For y=1 To MapWidth()
For x=1 To MapWidth()
    If GetMap2(0,x,y)=137 Then i=i+1
Next x
Next y

'Remove map from memory
DeleteObject map

AddText "DONE"
AddText ""
AddText "Tile 137 occurred "+i+" times."
DrawScreen

WaitKey

<<TAKAISIN