CreateMap
CreateMap MapIndex, NumbOfLevels
 
Parameters:

    MapIndex = The Index Identifier of the Map that you wish to create.
    NumbOfLevels = The Number of levels you like to assign this map
Returns: NONE
 

      CreateMap initializes a self contained mapping system, with provision for a user defined number of levels to be stored within it.

      The Map is really the parent system. It's used to house the various ingredients needed for creating 2D maps. Which are, the Block Set (the tile graphics), the Levels (layers to those familiar with Mappy) and any Block animation information.

      Each map can only have one set of Block graphics and block animations embedded within it. But there is no limit to the number of levels a map can contain.

      Each level assigned to a map, will use that maps Block Graphics and Animations when the level is drawn. This allows you to store many different levels that share the same Block graphics and animations together. Moreover, each level can also have an independent size and different drawing settings if you need. So some can be transparent, some solid and others animated.

      In case your unsure, Mapping is used in all sorts of classic games. And is generally used to create a larger playing area than the screen. You would no doubt have seen them in 2D games from shoot-em-ups like RType and Xenon, through to plat formers like Rainbow Islands, gods, Sonic, Mario Brothers and many many more.

      Conceptually, a level is nothing more than a large grid (array if you will) of block numbers. When the level is drawn, PlayBASIC uses the level blocks numbers to draw the corresponding block graphic at this grid position. So large worlds are really just made up of smaller block fragments.

      I strongly recommend reading the Maps Tutorial in the about section and checking out the Map examples that can be found in the PlayBASIC/Projects/Examples/Map folder and attached the command examples here in the help.




FACTS:


      * Maps are a big container that house the Maps Block Graphics, Level Arrays and Block Animations data altogether.

      * To import/load Block Graphics into a map see CreateMapGFX, LoadMapGFX

      * To attach a level to your map see Createlevel or Newlevel .

      * Please read the Maps Tutorial in the About section.




SAMPLE:


      The following screen shot is from a PlayBASIC game called "Who Framed Waldo", which was written for 2008 PlayBASIC game programming competition.







Mini Tutorial:


      This example will create a map with provision for 10 levels. Each level can be any size you like.

  
  
; Create map 1, with room for 10 levels.
  CreateMap 1,10
  
; Display the Info about this map.
  
  Print "Map Status:"+Str$(GetMapStatus(1))
  Print "Number Of Levels:"+Str$(GetMapLevels(1))
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  




This example would output.

  
  Map Status:1
  Number Of Levels:10
  

 
Related Info: CreateLevel | CreateMapAnim | CreateMapGfx | DeleteMap | LoadMapGfx | MakeMapGfx | Maps | NewMap :
 


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