PeekMapAnim
BlockIndex = PeekMapAnim(MapIndex, AnimIndex, FrameIndex)
 
Parameters:

    MapIndex = The Index of the Map that you to query an block animation within
    AnimIndex = The Index of the blockanimation to query
    FrameIndex = The position within the animation to read the block from
Returns:

    BlockIndex = The block index you just read from this animation
 

      The PeekMapAnim function reads a block index from a previously created block animation sequence.



FACTS:


      * None



Mini Tutorial:


      This example shows the hands on creation of a Map, and the basic creation of a map Anim. It then stores a series of block indexes with the anim and then displays the anim information back to the screen for you.


  
; ==============================
; Part 1 - Create Map
; ==============================
  
; Set Width & Height variables of the Map tiles
  TileWidth=16
  Tileheight=16
  
; Create a map with provision for 5 levels
  MyMap=NewMap(5)
  
; ==============================
; Part 2 - Create Tile Animations
; ==============================
  
; Create Room for 5 Block Animations with this map
  MapAnimQuantity MyMap,5
  
; Create Anim 1,with space for 10 frames in the anim
  CreateMapAnim MyMap,1,10
  
; Poke some frames into the Anim 1
  For lp=0 To 10
     PokeMapAnim MyMap,1,lp,10+lp
  Next
  
; Display the Block Index within this anim
  
  For Frames=0 To GetMapAnimSize(myMap,1)
     Print "Frame #"+Str$(frames)+"  "+Str$(PeekMapAnim(myMap,1,Frames))
  Next
  
; Display the screen and loop back to the DO
  Sync
  WaitKey
  
  



This example would output.

  
  Frame #0 10
  Frame #1 11
  Frame #2 12
  Frame #3 13
  Frame #4 14
  Frame #5 15
  Frame #6 16
  Frame #7 17
  Frame #8 18
  Frame #9 19
  Frame #10 20
  

 
Related Info: CreateMapAnim | DeleteMapAnim | GetMapAnimSize | GetMapAnimStatus | GetMapAnimType | MapAnimCurrentFrameRate | MapAnimFrameRate | MapAnimQuantity | MapAnimType | PokeMapAnim :
 


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