NewLevel
LevelIndex = NewLevel(MapIndex, Width, Height)
 
Parameters:

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

    LevelIndex = The index of the newly created level
 

      The NewLevel() function will dynamically create a level within to a map and return it's index. So such you only need to specify the map and the width and height of the level in tiles.



FACTS:


      * Levels can not be drawn until the maps graphics blocks have been loaded/created.

      * 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 new map with provision for 5 levels
  MyMap=NewMap(5)
  
; Create a new level of size 100x,200y, and attach
; it to MyMap
  MyLevel=NewLevel(MyMap,100,200)
  
; Display the Info about the map and it's levels
  Print "Map Index:"+Str$(MyMap)
  Print "# of Levels MyMap has:"+Str$(GetMapLevels(MyMap))
  
; Display the info about this MyLevel in MyMap
  Print "Map Level Status:"     +Str$(GetLevelStatus(MyMap,MyLevel))
  Print "Map Level Width:"     +Str$(GetLevelWidth(MyMap,MyLevel))
  Print "Map Level Height:"     +Str$(GetLevelHeight(MyMap,MyLevel))
  
; 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: CreateLevel | CreateMap | DrawMap | GetFreeMap | GetFreeMapLevel | Maps | NewMap :
 


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