FANDOM


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

XML elements Edit

<object name="Moon Child" type="player" color="0x2492ff" instructions="Arrow keys or WASD to move.">
 <shape destroyable="true">
  <perimeter>
   <polygon x="0" y="0">
    <vertex x="-0.38" y="-0.1975"/>
    <vertex x="0.38" y="-0.1975"/>
    <vertex x="0.25" y="0.3575"/>
    <vertex x="0.1" y="0.4775"/>
    <vertex x="-0.1" y="0.4775"/>
    <vertex x="-0.25" y="0.3575"/>
   </polygon>
  </perimeter>
  <visual type priority url text font sourcePixelsPerMeter bitmapRelCentroidX bitmapRelCentroidY size outline/>
  <physics friction bounciness anchored density solid angularDeceleration deceleration angleLock ignoreSetAng gravity collisionSoundURL collisionSoundPriority source/>
  <prismaticJoint angOffset length/>
  <revoluteJoint x y/>
 </shape>
 <controller>
  <keyPress action key extraKey/>
  <regularInterval interval/>
  <onDestroyed/>
  <randomInterval shortInterval longInterval/>
  <always/>
  <mouseButton action/>
  <otherSighted maxDist angleOffset type/>
  <otherCollided side typeFilter minForce onlyLoose>
   <awardScoreOfOther scoreOnce typeFilter/>
   <addLife livesAwarded/>
   <thrust groundHug impulse speedLimit onePerLife forceAsAbsoluteVel absoluteAng offsetAng rangeOfMaxImpulse/>
   <scoreSelf scoreOnce/>
   <destroyOther/>
   <shoot projectile xOffset yOffset angleOffset vAngle impulse reloadTime angleInaccuracy rangeOfMaxImpulse onePerLife angleAtTarget inheritMomentum inheritGoalStatus rotateChild/>
   <pullTarget speed/>
   <faceMoveDir/>
   <teleportOther/>
   <wrapPosition hWrap vWrap/>
   <yankOther force offsetAng maxDist/>
   <targetTypeNearest targetType needsLOS mustBeDestroyable/>
   <torque torque/>
   <moveToTarget groundHug absoluteForce movePower minDist/>
   <threeTouch/>
   <warpPlayer/>
   <destroySelf forceDestroy/>
   <addAng angle/>
   <targetOther/>
   <regulateSpeed min max/>
   <playAnim animLabel/>
   <oscillate range pauseTime moveSpeed offsetAng/>
   <moveToMouse groundHug absoluteForce movePower minDist/>
   <emitPFX sourcePixelsPerMeter lifetime quantity scale color_r color_g color_b velocity inheritRotation inheritMomentum angleOffset resistance gravity visualURL alpha vAngle xOffset yOffset/> <thrustOther velocity offsetAng/>
   <lookAtTarget secondaryDisplayLayerOnly turnSpeed/>
   <explode typeFilter blastRadius killRadius destroySelf blastImpulse/>
  </otherCollided>
 </controller>
</object>

<object></object> Edit

Compulsory.

  • name
Name of the piece, can also be changed when finishing the piece.
  • type
Type of the piece. Possible types are: player, world, enemy, treasure, key, lock
  • instructions
Only if player piece. Will be displayed on the instructions screen of the game.
  • golfScore
"yes" causes deaths to be added to a total instead of having lives.
  • score
The default score of the piece. Only works for treasures and enemies.
  • color
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.
  • alpha
The default transparency settings for the piece.
  • startLives
The default amount of lives of the player piece.

<shape></shape> Edit

Compulsory. Defines how the piece interacts with other pieces and the screen.

  • decor
If true, it won't inteact with anything. Default value: "false"
  • destroyable
Whether the piece is destroyable or not. Default value: "false"
  • invisCollision
If set to "true", <otherCollided> won't be triggered off for other pieces that hit the piece and the piece itself. Default value: "false"
  • climbable
Whether the piece is climbable or not. Climbable pieces tell other pieces that they are 'grounded' when they are over them. Default value: "false"

<perimeter></perimeter> Edit

The piece's shape.

<circle/> Edit

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

  • x
  • y
  • radius
<box/> Edit

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

  • x
  • y
  • width
  • height
<polygon></polygon> Edit

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°.

  • x
  • y
<vertex/> Edit

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

  • x
  • y

<visual/> Edit

the piece's appearance.

  • type
The type of the graphics. Possible values: jpg, swf
  • priority
The layering of the piece. If it's 3 or below, the piece can move without the graphics moving.
  • url
The URL of the piece's graphics.
  • text
The default text for the piece. Only use for text pieces.
  • font
The text's font. Only use for text pieces.
  • sourcePixelsPerMeter
How many of the graphics' pixel fill one of PlayCrafter's meters.
  • bitmapRelCentroidX
X-offset for images in pixels.
  • bitmapRelCentroidY
Y-offset for images in pixels.
  • size
The Graphics' size. Default value: 1
  • outline
If "on", a black line displays the shape defined in <perimeter>. Usage of this to get around not having Premium is discouraged.

<physics/> Edit

  • friction
Default friction of the piece. Changeable in the Piece Editor.
  • bounciness
Default bounciness of the piece. Changeable in the Piece Editor.
  • anchored
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.
  • density
Default density of the piece. Changeable in the Piece Editor.
  • solid
Whether the piece is solid or not. Use "editable" to be able to set it in the Piece Editor.
  • angularDeceleration
How much rotation is reduced over time.
  • deceleration
How much the speed is reduced over time.
  • angleLock
Whether the piece can rotate or not.
  • ignoreSetAng
If "true", you can't turn it in the Workshop.
  • gravity
Whether the piece is affected by gravity or not. Use "editable" to be able to set it in the Piece Editor.
  • collisionSoundURL
The URL of the collision sound.
  • collisionSoundPriority
The proirity of the collision sound. Use a high value to make sure it can be heard.
  • source
"perimeter": has the shape defined in <perimeter>; "visual_as_rectangle": Use for text pieces. Auto-adjusts the perimeter to the text's size.

<prismaticJoint/> Edit

Makes the piece able to only move in one direction.

  • angOffset
The angle offset of the prispatic joint. Measured clockwise.
  • length
The lenth of the prismatic joint. The piece can't move further if it reaches the end of it.

<revoluteJoint/> Edit

Makes the piece rotate around a certain point.

  • x
  • y

<controller></controller> Edit

Contains the stimuli.

<keyPress></keyPress> Edit

Triggers when a key is pressed.

  • action
"OnDown": when the key is pressed; "WhileDown": While the key is pressed
  • key
Which key
  • extraKey
Alternative key

<regularInterval></regularInterval> Edit

Triggers regularly.

  • interval

The interval, measured in seconds.

<onDestroyed></onDestroyed> Edit

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

<randomInterval></randomInterval> Edit

Triggers at a random period between shortInterval and longInterval.

  • shortInterval

Minimum possible time in seconds.

  • longInterval

Maximum possible time in seconds.

<always></always> Edit

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

<mouseButton></mouseButton> Edit

Triggers when the left mouse button is pressed.

  • action
"OnDown": when the key is pressed; "WhileDown": While the key is pressed

<otherSighted></otherSighted> Edit

Triggers when the piece is in sight of another piece.

  • maxDist
Maximum distancethe other piece can be for the stimulus to trigger off.
  • angleOffset
Angle offset. Measured clockwise.
  • type
The object sighted has to be of a certain type for the stimulus to trigger off.

<otherCollided></otherCollided> Edit

Triggers when the piece collides.

  • side
Which side the piece collides. Possible values: right, left, up, down (not verified)
  • typeFilter
Triggers only if the collided piece is of a certain type.
  • minForce
The minimum force the other piece ha to hit the piece for the stimulus to trigger off.
  • onlyLoose
Triggers only if the other piece isn't anchored.
<awardScoreOfOther/> Edit

Awards the other piece's score.

  • scoreOnce
  • typeFilter
<addLife/> Edit

Adds a life.

  • livesAwarded

How many lives? Default is 1.

<thrust/> Edit

Moves the piece.

  • groundHug
If "true", it will only work on the ground.
  • impulse
The force the piece is affected with.
  • speedLimit
The maximum speed the piece can achieve with this thrust.
  • onePerLife
If "true", the piece can only thruse once per life. Useful for golf balls.
  • forceAsAbsoluteVel
Doesn't thrust but set the velocity for the piece.
  • absoluteAng
If "true", it will go exactly in the same direction as if it were upright, no matter what.
  • offsetAng
The angle offset of the force.
  • rangeOfMaxImpulse
<scoreSelf/> Edit

Awards the piece's score.

  • scoreOnce
<destroyOther/> Edit

Destroys the other piece.

<shoot/> Edit

Shoots a projectile.

  • projectile
Use one of PlayCrafter's default projectiles or the ID of a piece.
  • xOffset
  • yOffset
  • angleOffset
  • vAngle
Rotational speed of the projectile.
  • impulse
The force the projectile is shot off with.
  • reloadTime
The minimum amount of time between two shots.
  • angleInaccuracy
  • rangeOfMaxImpulse
  • onePerLife
If "true", the piece can only shoot once per life.
  • angleAtTarget
  • inheritMomentum
Whether the projectile inmherits the momentum of the piece or not.
  • inheritGoalStatus
Whether the projetctile inherits the goal status of the piece or not.
  • rotateChild
<pullTarget/> Edit

Tugs on any target selected by another XML tag.

  • speed

How fast?

<faceMoveDir/> Edit

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

<teleportOther/> Edit

Teleports the other piece.

<wrapPosition/> Edit

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

  • hWrap
horizontal wrap
  • vWrap
Vertical wrap
<yankOther/> Edit
  • force
  • offsetAng
  • maxDist
<targetTypeNearest/> Edit

Targets another piece.

  • targetType
  • needsLOS
  • mustBeDestroyable
<torque/> Edit

Rotates the piece.

  • torque
<moveToTarget/> Edit
  • groundHug
  • absoluteForce
  • movePower
  • minDist
<threeTouch/> Edit

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

<warpPlayer/> Edit

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.

<destroySelf/> Edit

Destroys the piece.

  • forceDestroy
If "true", the piece will still be destroyed if it's undestroyable. Else, only <onDestroyed> will be triggered.
<addAng/> Edit

Forces an amount of rotation into the piece. It will also rotate if it is anchored.

  • angle

How much the piece is rotated. If set to zero, it will randomly rotate.

<targetOther/> Edit

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

<regulateSpeed/> Edit

Checks how fast the piece is moving, and if the speed is outside the min and max, the speed will be adjusted.

  • min

Minimum speed allowed. Set to 0 for no minimum.

  • max

Maximum speed allowed. Set to 0 to completely stop motion.

<playAnim/> Edit

Plays the animation with the label declared in animLabel. Does only work when a correct swf is used as graphics.

  • animLabel

Chooses which animation set in the swf to play. Obviously will not work if label does not exist in swf.

<oscillate/> Edit

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.

  • range

How far the piece moves.

  • pauseTime

When the piece finishes, how long it waits before moving again.

  • moveSpeed

How fast oscillation occurs.

  • offsetAng

Direction.

<moveToMouse/> Edit

Forces the piece to move to the mouse.

  • groundHug
  • absoluteForce
  • movePower
  • minDist
<emitPFX/> Edit

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

  • sourcePixelsPerMeter
  • lifetime
  • quantity
  • scale
  • color_r
  • color_g
  • color_b
  • velocity
  • inheritRotation
  • inheritMomentum
  • angleOffset
  • resistance
  • gravity
  • visualURL
  • alpha
  • vAngle
  • xOffset
  • yOffset
<thrustOther/> Edit
  • velocity
  • offsetAng
<lookAtTarget/> Edit

The piece looks at the target specified by <targetTypeNearest/> or <targetOther/>.

  • secondaryDisplayLayerOnly
  • turnSpeed
<explode/> Edit

The piece explodes... Invisibly. You'll need to create your own appearance using animation or some other means.

  • typeFilter
If set, the explosion only affects pieces of a certain type.
  • blastRadius
The radius in which other pieces are blasted away.
  • killRadius
The radius in which other pieces are destroyed.
  • destroySelf
Whether the piece itself is destroyed by the explosion or not.
  • blastImpulse
The force the other pieces are blown away with.

Conditions Edit

For all stimuli, you can add one or more of the following conditions, causing the stimuli to only act if these conditions are met:

  • mustBeGrounded

The piece must be on the ground. Works like groundHug.

  • mustBeAirborne
The piece must be in mid-air.
  • notStopped
The piece must have motion.
  • notMoving
The piece must NOT have motion.
  • movingUp
The piece must be moving up.
  • movingDown
The piece must be moving down.
  • movingLeft
The piece must be moving left.
  • movingRight
The piece must be moving right.
  • facingUp
The piece must be looking up.
  • facingDown
The piece must be looking down.
  • facingLeft
The piece must be looking left.
  • facingRight
The piece must be looking right.
  • notRising
The piece must not be moving upwards.
  • notLateral
The piece must not move neither right nor left.
  • fireOnce
The stimulus only triggers once.
  • compassDirection
Intended for isometric pieces, but usable with other styles of pieces. Possible values are: N, NE, E, SE, S, SW, W, NW.
  • afterDelay
Triggers the actions a certain time after the stimulus was triggered.

BlockAnim Edit

BlockAnim="true" can be used in every action to stop the animation. Actually only useful in <playAnim/> 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.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.