Methods and Functions with Sprite Subclass

Here is a list of Methods and Functions included in the Sprite Subclass. These are designed to mimic some of the Scratch commands.

Methods needing parameters:

Method
Example
Purpose
MoveSteps(integer)
MoveSteps(10)
Move Actor specified number of steps in direction actor is pointing.
Turn(integer)
Turn(45)
Turn Actor in degrees.  Positive numbers turn right. Negative numbers turn left.
GoTo(integer x, integer y)
GoTo(40, 50)
Move Actor to x and y coordinates on world.
setRotation(integer)
setRotation(45)
Point Actor at 45 degrees.

Methods without parameters:

Command
Example
Purpose
IfOnEdgeBounce()
IfOnEdgeBounce()
Allows Actor to bounce of edge of world.
goToMouse()
goToMouse()
Move Actor to mouse pointer.
pointAtMouse()
pointAtMouse()
Points Actor at Mouse Pointer.
EdgeTransfer()
EdgeTransfer()
Allows Actor to "pass through" edge of world to other side.

Functions:  (Returns a value)

Command
Example
Purpose
MouseX()

Returns Mouse X position
MouseY()

Returns Mouse Y postition
getX()

Returns X position of Actor
getY()

returns Y position of Actor
getRotation()

Returns current Rotation of Actor

Email Mr.Michaud

Copyright ©2011 Mr. Michaud.