XML

The XML of a piece defines it, but you can adjust the heaviness, friction, etc. in the Piece Editor.

XML elements
                <otherSighted maxDist angleOffset type/> <otherCollided side typeFilter minForce onlyLoose> <awardScoreOfOther scoreOnce typeFilter/> <addLife livesAwarded/> <thrust groundHug impulse speedLimit onePerLife forceAsAbsoluteVel absoluteAng offsetAng rangeOfMaxImpulse/> == Compulsory.
 * Name of the piece, can also be changed when finishing the piece.
 * Name of the piece, can also be changed when finishing the piece.


 * Type of the piece. Possible types are: player, world, enemy, treasure, key, lock
 * Type of the piece. Possible types are: player, world, enemy, treasure, key, lock


 * Only if player piece. Will be displayed on the instructions screen of the game.
 * Only if player piece. Will be displayed on the instructions screen of the game.


 * "yes" causes deaths to be added to a total instead of having lives.
 * "yes" causes deaths to be added to a total instead of having lives.


 * The default score of the piece. Only works for treasures and enemies.
 * The default score of the piece. Only works for treasures and enemies.


 * The default color of the piece. Only applies when you copy the piece and the color is not already used for another instance of the piece.
 * The default color of the piece. Only applies when you copy the piece and the color is not already used for another instance of the piece.


 * The default transparency settings for the piece.
 * The default transparency settings for the piece.


 * The default amount of lives of the player piece.
 * The default amount of lives of the player piece.

Compulsory. Defines how the piece interacts with other pieces and the screen.
 * If true, it won't inteact with anything. Default value: "false"
 * If true, it won't inteact with anything. Default value: "false"


 * Whether the piece is destroyable or not. Default value: "false"
 * Whether the piece is destroyable or not. Default value: "false"


 * If set to "true",  won't be triggered off for other pieces that hit the piece and the piece itself. Default value: "false"
 * If set to "true",  won't be triggered off for other pieces that hit the piece and the piece itself. Default value: "false"


 * Whether the piece is climbable or not. Climbable pieces tell other pieces that they are 'grounded' when they are over them. Default value: "false"
 * Whether the piece is climbable or not. Climbable pieces tell other pieces that they are 'grounded' when they are over them. Default value: "false"

The piece's shape.

Adds a circle. x/y-coordinates determine the center of the circle.

Adds a box. x/y-coordinates determine the center of the box.

Adds a polygon. x/y-coordinates should be added to the vertexes' coordinates, but they don't.

Note: polygons mustn't be concave, meaning there must not be any angle over 180°.

Defines a vertex of a polygon. The maximum amount of vertexes per polygon is 8.

the piece's appearance.
 * The type of the graphics. Possible values: jpg, swf
 * The type of the graphics. Possible values: jpg, swf


 * The layering of the piece. If it's 3 or below, the piece can move without the graphics moving.
 * The layering of the piece. If it's 3 or below, the piece can move without the graphics moving.


 * The URL of the piece's graphics.
 * The URL of the piece's graphics.


 * The default text for the piece. Only use for text pieces.
 * The default text for the piece. Only use for text pieces.


 * The text's font. Only use for text pieces.
 * The text's font. Only use for text pieces.


 * How many of the graphics' pixel fill one of PlayCrafter's meters.
 * How many of the graphics' pixel fill one of PlayCrafter's meters.


 * X-offset for images in pixels.
 * X-offset for images in pixels.


 * Y-offset for images in pixels.
 * Y-offset for images in pixels.


 * The Graphics' size. Default value: 1
 * The Graphics' size. Default value: 1


 * If "on", a black line displays the shape defined in . Usage of this to get around not having Premium is discouraged.
 * If "on", a black line displays the shape defined in . Usage of this to get around not having Premium is discouraged.


 * Default friction of the piece. Changeable in the Piece Editor.
 * Default friction of the piece. Changeable in the Piece Editor.


 * Default bounciness of the piece. Changeable in the Piece Editor.
 * Default bounciness of the piece. Changeable in the Piece Editor.


 * Whether the piece is anchored or not (causes it to have a fixed position and rotation). Use "editable" to be able to set it in the Piece Editor.
 * Whether the piece is anchored or not (causes it to have a fixed position and rotation). Use "editable" to be able to set it in the Piece Editor.


 * Default density of the piece. Changeable in the Piece Editor.
 * Default density of the piece. Changeable in the Piece Editor.


 * Whether the piece is solid or not. Use "editable" to be able to set it in the Piece Editor.
 * Whether the piece is solid or not. Use "editable" to be able to set it in the Piece Editor.


 * How much rotation is reduced over time.
 * How much rotation is reduced over time.


 * How much the speed is reduced over time.
 * How much the speed is reduced over time.


 * Whether the piece can rotate or not.
 * Whether the piece can rotate or not.


 * If "true", you can't turn it in the Workshop.
 * If "true", you can't turn it in the Workshop.


 * Whether the piece is affected by gravity or not. Use "editable" to be able to set it in the Piece Editor.
 * Whether the piece is affected by gravity or not. Use "editable" to be able to set it in the Piece Editor.


 * The URL of the collision sound.
 * The URL of the collision sound.


 * The proirity of the collision sound. Use a high value to make sure it can be heard.
 * The proirity of the collision sound. Use a high value to make sure it can be heard.


 * "perimeter": has the shape defined in ; "visual_as_rectangle": Use for text pieces. Auto-adjusts the perimeter to the text's size.
 * "perimeter": has the shape defined in ; "visual_as_rectangle": Use for text pieces. Auto-adjusts the perimeter to the text's size.

Makes the piece able to only move in one direction.
 * The angle offset of the prispatic joint. Measured clockwise.
 * The angle offset of the prispatic joint. Measured clockwise.


 * The lenth of the prismatic joint. The piece can't move further if it reaches the end of it.
 * The lenth of the prismatic joint. The piece can't move further if it reaches the end of it.

Makes the piece rotate around a certain point.

Contains the stimuli.

Triggers when a key is pressed.
 * "OnDown": when the key is pressed; "WhileDown": While the key is pressed
 * "OnDown": when the key is pressed; "WhileDown": While the key is pressed


 * Which key
 * Which key


 * Alternative key
 * Alternative key

Triggers regularly. The interval, measured in seconds.

Triggers when the piece is destroyed. Works also if the piece isn't destroyable.

Triggers at a random period between  and. Minimum possible time in seconds. Maximum possible time in seconds.

Triggers on every frame, afterDelay things cause it to behave like a  stimulus.

Triggers when the left mouse button is pressed.
 * "OnDown": when the key is pressed; "WhileDown": While the key is pressed
 * "OnDown": when the key is pressed; "WhileDown": While the key is pressed

Triggers when the piece is in sight of another piece.
 * Maximum distancethe other piece can be for the stimulus to trigger off.
 * Maximum distancethe other piece can be for the stimulus to trigger off.


 * Angle offset. Measured clockwise.
 * Angle offset. Measured clockwise.


 * The object sighted has to be of a certain type for the stimulus to trigger off.
 * The object sighted has to be of a certain type for the stimulus to trigger off.

Triggers when the piece collides.
 * Which side the piece collides. Possible values: right, left, up, down (not verified)
 * Which side the piece collides. Possible values: right, left, up, down (not verified)


 * Triggers only if the collided piece is of a certain type.
 * Triggers only if the collided piece is of a certain type.


 * The minimum force the other piece ha to hit the piece for the stimulus to trigger off.
 * The minimum force the other piece ha to hit the piece for the stimulus to trigger off.


 * Triggers only if the other piece isn't anchored.
 * Triggers only if the other piece isn't anchored.

Awards the other piece's score.

Adds a life. How many lives? Default is 1.

Moves the piece.
 * If "true", it will only work on the ground.
 * If "true", it will only work on the ground.


 * The force the piece is affected with.
 * The force the piece is affected with.


 * The maximum speed the piece can achieve with this thrust.
 * The maximum speed the piece can achieve with this thrust.


 * If "true", the piece can only thruse once per life. Useful for golf balls.
 * If "true", the piece can only thruse once per life. Useful for golf balls.


 * Doesn't thrust but set the velocity for the piece.
 * Doesn't thrust but set the velocity for the piece.


 * If "true", it will go exactly in the same direction as if it were upright, no matter what.
 * If "true", it will go exactly in the same direction as if it were upright, no matter what.


 * The angle offset of the force.
 * The angle offset of the force.



Awards the piece's score.

Destroys the other piece.

Shoots a projectile.
 * Use one of PlayCrafter's default projectiles or the ID of a piece.
 * Use one of PlayCrafter's default projectiles or the ID of a piece.


 * Rotational speed of the projectile.
 * Rotational speed of the projectile.
 * Rotational speed of the projectile.
 * Rotational speed of the projectile.
 * Rotational speed of the projectile.


 * The force the projectile is shot off with.
 * The force the projectile is shot off with.


 * The minimum amount of time between two shots.
 * The minimum amount of time between two shots.


 * If "true", the piece can only shoot once per life.
 * If "true", the piece can only shoot once per life.
 * If "true", the piece can only shoot once per life.
 * If "true", the piece can only shoot once per life.


 * Whether the projectile inmherits the momentum of the piece or not.
 * Whether the projectile inmherits the momentum of the piece or not.
 * Whether the projectile inmherits the momentum of the piece or not.


 * Whether the projetctile inherits the goal status of the piece or not.
 * Whether the projetctile inherits the goal status of the piece or not.



Tugs on any target selected by another XML tag. How fast?

The piece faces the direction it is moving in, and if not moving it defaults at East. Useful for projectiles.

Teleports the other piece.

Lets the piece appear on the other side of the screen if it'd else go out. Doesn't work with solid pieces.
 * horizontal wrap
 * horizontal wrap


 * Vertical wrap
 * Vertical wrap

Targets another piece.

Rotates the piece.

Code of the 3 connect gem. Causes the piece to self-destruct if at least three same-colored versions of itself are touching.

Warps the player to another level or just teleports him, depending on whether there's another piece of it's kind in the level or not.

Destroys the piece.
 * If "true", the piece will still be destroyed if it's undestroyable. Else, only  will be triggered.
 * If "true", the piece will still be destroyed if it's undestroyable. Else, only  will be triggered.

Forces an amount of rotation into the piece. It will also rotate if it is anchored. How much the piece is rotated. If set to zero, it will randomly rotate.

Targets the other piece, if named by another XML tag.

Checks how fast the piece is moving, and if the speed is outside the min and max, the speed will be adjusted. Minimum speed allowed. Set to 0 for no minimum. Maximum speed allowed. Set to 0 to completely stop motion.

Plays the animation with the label declared in. Does only work when a correct swf is used as graphics. Chooses which animation set in the swf to play. Obviously will not work if label does not exist in swf.

Causes the piece to move back and forth in one direction. Best used with an always parent. All three tags here work with the "editable" setting. How far the piece moves. When the piece finishes, how long it waits before moving again. How fast oscillation occurs. Direction.

Forces the piece to move to the mouse.

Emits particles. see Particle Effect for more details. PFX take a visualPriority of 3.

The piece looks at the target specified by  or.

The piece explodes... Invisibly. You'll need to create your own appearance using animation or some other means.
 * If set, the explosion only affects pieces of a certain type.
 * If set, the explosion only affects pieces of a certain type.


 * The radius in which other pieces are blasted away.
 * The radius in which other pieces are blasted away.


 * The radius in which other pieces are destroyed.
 * The radius in which other pieces are destroyed.


 * Whether the piece itself is destroyed by the explosion or not.
 * Whether the piece itself is destroyed by the explosion or not.


 * The force the other pieces are blown away with.
 * The force the other pieces are blown away with.

Conditions
For all stimuli, you can add one or more of the following conditions, causing the stimuli to only act if these conditions are met: The piece must be on the ground. Works like.
 * The piece must be in mid-air.
 * The piece must be in mid-air.


 * The piece must have motion.
 * The piece must have motion.


 * The piece must NOT have motion.
 * The piece must NOT have motion.


 * The piece must be moving up.
 * The piece must be moving up.


 * The piece must be moving down.
 * The piece must be moving down.


 * The piece must be moving left.
 * The piece must be moving left.


 * The piece must be moving right.
 * The piece must be moving right.


 * The piece must be looking up.
 * The piece must be looking up.


 * The piece must be looking down.
 * The piece must be looking down.


 * The piece must be looking left.
 * The piece must be looking left.


 * The piece must be looking right.
 * The piece must be looking right.


 * The piece must not be moving upwards.
 * The piece must not be moving upwards.


 * The piece must not move neither right nor left.
 * The piece must not move neither right nor left.


 * The stimulus only triggers once.
 * The stimulus only triggers once.


 * Intended for isometric pieces, but usable with other styles of pieces. Possible values are: N, NE, E, SE, S, SW, W, NW.
 * Intended for isometric pieces, but usable with other styles of pieces. Possible values are: N, NE, E, SE, S, SW, W, NW.


 * Triggers the actions a certain time after the stimulus was triggered.
 * Triggers the actions a certain time after the stimulus was triggered.

can be used in every action to stop the animation. Actually only useful in  to stop all other animations. Certain ways to develop the swf will allow it to start being given new playAnim commands, but how it works will not be went over here, as this is not the appropriate topic.