Sprite

The Sprite component gives the NewBASIC programmer the power to create vivid animations and video game quality motion. A sprite stores separate graphic images in a frame array of draw components.

Sprite Properties

x as integer
The x position of this sprite.

y as integer
The y position of this sprite.

xVel as integer
The x portion of the velocity vector of this sprite. Sprites given a non-zero velocity move along the indicated axis.

yVel as integer
The y portion of the velocity vector of this sprite. Sprites given a non-zero velocity move along the indicated axis.

rotation as integer
The current rotation of this sprite.

color as integer
The current color of this sprite.

imageCount as integer
The number of images in the frame array to be animated.

Sprite Events

None.

Sprite Actions

setframe()

setframe(frameNum as integer, graphic as long) as integer

This action sets the given frame in the frame array to the given graphic.

getframe()

getframe(frameNum as integer) as long

This action returns the frame at the given offset.