Physics
Top  Previous  Next


To simplify gaming and other scripted movement, SWiSHscript supports additional properties that let you define the velocity, acceleration and friction of an Object or Sprite.

Some of the standard Sprite properties, have physics extensions.

To enable these properties you must turn on physics for the Movie and each individual Object that uses these properties. See Enable Movie Physics and Enable Object Physics for more information.

Example
The property _X has the SWiSHscript physics extensions _aX, _vX, _fX where:
·_aX represents the acceleration in pixels/second/second  
·_vX represents the velocity in pixels/second  
·_fX represents the movement friction percentage.  

The table of properties with physics extensions and the properties representing those extensions is shown below:

Property
Acceleration Property
Friction Property
Velocity Property
_alpha
_aalpha (% / sec / sec)
_falpha (%)
_valpha (% / sec)
_rotation
_arotation (deg / sec / sec)
_frotation (%)
_vrotation (deg / sec)
_X
_aX (pixels / sec / sec)
_fX (%)
_vX (pixels / sec)
_xscale
_axscale (% / sec / sec)
_fxscale (%)
_vxscale (% / sec)
_Y
_aY (pixels / sec / sec)
_fY (%)
_vY (pixels / sec)
_yscale
_ayscale (% / sec / sec)
_fyscale (%)
_vyscale (% / sec)


The additional properties _age, _delta and _time are also provided to assist with age and movement calculations.