MoveSpriteY
MoveSpriteY SpriteIndex, Ydist#
 
Parameters:

    SpriteIndex = The identifier of the sprite you wish to create
    Ydist# = The value to add to the Sprites Y position
Returns: NONE
 

      MoveSpriteY changes the sprite current position by applying a change to the Y position of the sprite.

      It's the same as the following manual calculation.

  
  x#=GetSpriteX(SpriteIndex)
  NewY#=GetSpriteY(SpriteIndex)+YDist#
  PositionSprite SpriteIndex,x#,NewY#
  




FACTS:


      * MoveSpriteY does not alter the X or Z positions of this sprite. See MoveSpriteX, MoveSpriteZ.

      * MoveSpriteY can support sliding collision with the approriate SpriteCollisionMode






Mini Tutorial:


      Create a sprite, set it's position, move it and display its new position to the screen.

  
; Create the Sprite
  CreateSprite 1
  
; Set this sprites entities X and Y Positions to 100x,200y
  PositionSprite 1100,200
  
; Add 10 to this sprites Y Position.
  MoveSpriteY 110
  
; Read and display sprite 1's position X,Y and Z position to the screen.
  Print GetSpriteX(1)
  Print GetSpriteY(1)
  Print GetSpriteZ(1)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output.

  
  100.0
  210.0
  0.0
  

 
Related Info: MoveSprite | MoveSpriteX | MoveSpriteZ | PositionSprite | PositionSpriteX | PositionSpriteXYZ | PositionSpriteY | PositionSpriteZ :
 


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