GetFreeMapLevel
LevelIndex = GetFreeMapLevel(MapIndex)
 
Parameters:

    MapIndex = The Index of a map to locate a free level within
Returns:

    LevelIndex = A free level index ready for use
 

      The GetFreeMapLevel function returns a free level index ready for creation.



FACTS:


      * Also see NewLevel



Mini Tutorial:


      This example shows how to first create a Map & Level, then displays the size information about this level.


  
; Create a new map with provision for 5 levels
  MyMap=NewMap(5)
  
; Request a Free Level index with this map
  MyLevel=GetFreeMapLevel(MyMap)
  
; Create level of size 100x,200y, and attach
; it To MYMap
  CreateLevel MyMap,MyLevel,100,200
  
  
; Display the Info about the map and it's level's
  Print "Map Index:"+Str$(MyMap)
  Print "Level Index:"+Str$(MyLevel)
  
; Display the info about Level 1 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
  Level Index:0
  Map Level Status:1
  Map Level Width:100
  Map Level Height:200
  

 
Related Info: CreateLevel | DeleteLevel | GetFreeMap | GetLevelStatus | NewLevel | NewMap :
 


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