UnderwareDesign
May 18, 2013, 03:13:30 PM *
News: Code Conversion - Convert Amos To PlayBASIC  (2nd,April,2013)
   Home    
Pages: [1]
 
Author Topic: Loading Exported Play Mapper Mini Levels  (Read 1332 times)
Member
Development Team


WWW
« on: February 18, 2008, 07:18:52 AM »


 This snippet is an example of how you can load Exported Layers from PlayMapper Mini into PB using the standard map extension library.   This library comes with PB and is in your Slib folder.

 Note: You'll obviously need you're own export Level files to test this snippet !

  
PlayBASIC Code:
   #include "Maps"

   Map=NewMap(10)

   Filename$=path$+"MyLevels.PBLevel"

   
   if Fileexist(Filename$)
      fh=GetFreeFile()
      readfile filename$,fh
      
         ; run through this file and load all of the levels stored in it
         while not EndOfFile(fh)
            ThisLevel=GetFreeMapLevel(Map)
            Status=ReadLevelFromFile(fh,Map,ThisLevel)            
            if Status=true
               print "Loaded Level"+Str$(ThisLevel)
               print "Width:"+Str$(GetLEvelWidth(map,ThisLevel))
               print "Height:"+Str$(GetLEvelWidth(map,ThisLevel))
            endif
            inc LevelsLoaded         
         endwhile
      closefile fh
   endif

   print LevelsLoaded
 
 Sync
 Waitkey
 




 Related LInks

    Load Play Mapper Maps

    Play Mapper (Work In Progress thread)

Logged

Pages: [1]
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2009, Simple Machines LLC | Privacy Policy Valid XHTML 1.0! Valid CSS!