MapAnimType
MapAnimType MapIndex, AnimIndex, Mode
 
Parameters:

    MapIndex = The Index of the Map that you wish to create an anim within
    AnimIndex = The Index of the tile animation to create
    Mode = The animation mode os this animation
Returns: NONE
 

      MapAnimType sets the animation type of a block animation. The animation type is used when animations are updated. It allows each animation to use it's own basic logic, from stepping through the frames forward, backwards, forward-once, backward-once, Ping pong forward, Ping Pong backwards or remaining idle.


      Mode Constants:

      PBMapAnim_Idle = Animation is Idle
      PBMapAnim_Forward = Animate forward
      PBMapAnim_BackWard = Animate backward
      PBMapAnim_ForwardOnce= Animate forward once (stops after reaching the end of the anim)
      PBMapAnim_BackwardOnce = Animate backward once (stops after reaching the end of the anim)
      PBMapAnim_PingPongForward = Ping Pong Animation forward
      PBMapAnim_PingPongBackward = Ping Pong Animation Backward




FACTS:


      * Animations Type default to a mode PBMapAnim_Forward.

      * Each time a Animation frame rate is changed using MapAnimFrameRate the current Frame rate is also set.




Mini Tutorial:


      This example shows the hands on creation of a Map, and the basic creation of a map Anims. It then displays the anims information for you. Which should give you a feel, for how the block animation commands are used together.


  
; ==============================
; 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 50 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
  
; Set the frame rate
  MapAnimFrameRate MyMap,1,3
  MapAnimCurrentFrameRate MyMap,1,2
  
; Set Animation Type  set anim 1 to backwards (mode 2)
  MapAnimType MyMap,1,pbmapanim_backward
  
  
; ==============================
; Part 3 - Display the Anim Information
; ==============================
  
  Print "Number Of Animations in Map:"+Str$(GetMapAnims(MyMap))
  
; List the Info about each Anim
  For Anim=0 To GetMapAnims(MyMap)
     If  GetMapAnimStatus(MyMap,Anim)=true
        Print "Anim #"+Str$(anim)
        f$=""
        Print "Frames:"+Str$(GetMapAnimSize(mymap,anim))
        Print "Frame Rate:"+Str$(GetMapAnimFrameRate(mymap,anim))
        Print "Current Frame Rate:"+Str$(GetMapAnimCurrentFrameRate(mymap,anim))
        Print "Anim Type:"+Str$(GetMapAnimType(mymap,anim))
        For Frames=0 To GetMapAnimSize(myMap,Anim)
           f$=f$+Str$(PeekMapAnim(myMap,anim,Frames))+","
        Next
        Print "Tile Sequence:"+TrimRight$(F$,",")
     Else
        Print "Anim #"+Str$(anim)+" Doesn't exist"
     EndIf
     Print ""
  Next
  
; Display the screen and loop back to the DO
  Sync
  WaitKey
  
  



This example would output.

  
  Anim #0 Doesn't exist
  
  Anim #1
  Frames:10
  Frame Rate:3
  Current Frame Rate:2
  Anim Type:2
  Tile Sequence:10,11,12,13,14,15,16,17,18,19,20
  
  Anim #2 Doesn't exist
  
  Anim #3 Doesn't exist
  
  Anim #4 Doesn't exist
  
  Anim #5 Doesn't exist
  

 
Related Info: CreateMapAnim | DeleteMapAnim | GetMapAnimStatus | MapAnimCurrentFrameRate | MapAnimFrameRate | UpdateMapAnims :
 


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