SpriteCollisionWorld
SpriteCollisionWorld SpriteIndex, WorldIndex
 
Parameters:

    SpriteIndex = The index of the sprite you wish to set
    WorldIndex = The index of the World this sprite should use for collision
Returns: NONE
 

      SpriteCollisionWorld sets the world this sprite will use when it's collision mode is set to Sliding Collision.



FACTS:


      * The sprite will only use the assigned world, when it's collision mode is set to Sliding

      * Sliding Collision only occurs on 'lines' captured to the world. The world must also have been partitioned.




Mini Tutorial:


      This simple example creates a world, the creates a sprite and assigned this sprite the previously created world. It then displays this information back to the user.


  
  
; Create world #10
  CreateWorld 10
  
; create Sprite #50
  CreateSprite 50
  
; assign World #10 as sprite 50's sliding collision world
  SpriteCollisionWorld 50,10
  
;Set Sprites Collision mode to Sliding Collision
  SpriteCollisionMode 50,4
  
; Read the Sprites currcent Collision world
  Print GetSpriteCollisionWorld(50)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




This example would output.

  
  10
  

 
Related Info: CreateWorld | GetSpriteWorldImpact | PartitionWorld | SpriteCollisionMode :
 


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