CreateLevel
CreateLevel MapIndex, LevelIndex, Width, Height
 
Parameters:

    MapIndex = The Index Identifier of the Map you wish to assign this level to.
    LevelIndex = The index of the level you wish to create.
    Width = The width of the level in tiles
    Height = The Height of the level in tiles
Returns: NONE
 

      Createlevel will create a level array within a map. So you need to specify the map you wish to store this level in, the levels index within the map and the width and height of the level in tiles.


FACTS:


      * Levels can not be drawn until the maps graphic blocks have been loaded/created. (CreateMapGFX,LoadMapGFX)

      * The Level Width parameter is in TILES not pixels.

      * The Level Height parameter is in TILES not pixels.




Mini Tutorial:


      This example shows how to first create a Map, then create a Level and display the information about this map and it's newly created map.


  
  
; Create a map with provision for 5 levels
  MyMap=NewMap(5)
  
; Create level 1 of size 100x,200y, and attach
; it To MYMap
  CreateLevel MyMap,1,100,200
  
; Display the Info about the map and it's level's
  Print "Map Index:"+Str$(MyMap)
  Print "# of Levels MYMap has:"+Str$(GetMapLevels(MyMap))
  
; Display the info abuot Level 1 in MyMap
  Print "Map Level Status:"     +Str$(GetLevelStatus(MyMap,1))
  Print "Map Level Width:"     +Str$(GetLevelWidth(MyMap,1))
  Print "Map Level Height:"     +Str$(GetLevelHeight(MyMap,1))
  
  
; Display the screen and wait for a key to be pressed
  Sync
  WaitKey
  
  



This example would output.

  
  Map Index:1
  # of Levels MYMap has:5
  Map Level Status:1
  Map Level Width:100
  Map Level Height:200
  

 
Related Info: CreateMap | DrawMap | GetFreeMap | GetFreeMapLevel | NewLevel | NewMap :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com