Clickteam Fusion 2.5 Documentation

Where do you want to go next?

You can get further help with this topic by going to the topic’s stem.

Questions / Answers

Share, email or print this help document.

Clickteam Fusion 2.5

Product(s) Required:

Clickteam Fusion 2.5 Developer, Clickteam Fusion 2.5 Standard, Clickteam Fusion MacOS, Clickteam Fusion Windows

The Physics – Engine object is the driving force behind your physics-based applications. It contains the code necessary to make the objects to move in a physical-oriented way. This object must be present in the frame if you use one of the physics-driven movements.
This object also contains a number of actions to control and affect the objects of your physical world.

The Properties
  • Gravity
    • Gravity strength
      This property contains the strength of the gravity of the physical world. The earth gravity value is around 10 (exactly 9.81), therefore the default value of this property is set to the earth gravity.
      You can change this value within the application with an action.
    • Gravity angle
      This property contains the angle of the gravity. The earth gravity is directed to the bottom, but you can define a gravity directed to the top or in a custom angle.
      The direction of the gravity can also be changed within the application with an action.
  • Backdrops
    • Add backdrop objects to the world
      If this property is checked, any Backdrop or Quick-Backdrop object of the frame will be added to the world as obstacle or platform (depending on the obstacle property of these objects). The result is that your physical game objects (any object with a physical movement) can collide with them.
      Please note that these background objects cannot move within the physical world. Their position is set at start of frame.
    • Friction
      This property contains the friction parameter of the created backdrop objects. A friction of zero will make all the other objects slide when they collide with them, like an Ice skate. A friction of 100 on the contrary will stop the other objects.
    • Elasticity
      This property is used to set the elasticity of the created backdrop objects. An elasticity of 100 will make all the other objects that collide with them bounce, transfering the speed to the bouncing direction. An elasticity of 0 will stop the colliding objects. Any value in-between will define the strength of the bounce.
  • Bullets
    • Create bullets in the physical world
      This property defines the behavior of the “Launch an object” action. If it is checked, all objects created with this action will be physical objects moving in the world, and will interact with the other physical objects. Clickteam Fusion 2.5 only creates a physical object from this action IF this property is checked, AND if the parent object (the object from which the bullet is launched) has one of the physical movements. If one of these conditions is false, then the bullet will be created using the normal, non-physical procedure.
    • Density
      This property contains the density of the bullets created by a “Launch object” action. A dense object (density=100) will be heavier, and therefore more difficult to move when colliding with other objects. On the other hand, it will have more force and will have more effect on static objects. The mass of the object is calculated by the engine from the surface of the object and from the density.
    • Friction
      This property defines how the created bullets behave when they are colliding with another object. A friction of 0 will make the object slide on the other object (like ice-skating). A friction of 100 will make it stop when it collides with another object (and influence the other object).
    • Elasticity
      This property contains the elasticity factor of the created bullets. Use a value of 0, and the bullets will stop as soon as they collides with another object. Use a value of 100, and the bullets will bounce, keeping the momentum of their movements. Intermediate values change the bouncing factor, and how the momentum is transfered while bouncing.
    • Gravity scale
      This property contains a percentage indicating how much of the physical world gravity must be applied to the bullets. A value 100 will apply the gravity as defined in the Physic Engine object. A value of 0 makes the bullet keep a straight line. A value of 200 will put a gravity twice as strong on the bullet, and thus make it fall faster.
  • Non-physical objects
    • Insert non physical objects in the world
      If checked, all the objects created with the classic, non-physical movements will also be added to the physical world. They will have an influence on the objects of the world, (they will be able to stop them for example). But this influence is limited, as they are not true physical objects. Their position and angle in the world are forced at every loop, something that Box2D does not like very much. Do not expect these objects to behave exactly like physical objects.
      This option can be very handy if you have objects with a path movement, they will be able to follow their path in the physical world.
      Warning, if this option is checked ALL the non-physical objects will be added, like scores, lives, buttons, strings of text etc. which might slow down the engine. You may want to use the “Add object to world” action instead.
    • Density non-physical
      This property contains the density of the non-physical objects added to the world.
    • Friction non-physical
      This property contains the friction of the non-physical objects added to the world.
  • Advanced
    • Engine ID
      This property should only be changed if you decide to use more than one Physics Engine object in your frame. You might want to do that if you want different objects to respond to different gravities. This property contains a number (that should be unique within the various Physics Engine objects in the frame), that will be used as a reference by the physics movements and objects. For example, if you set this ID to 2, only the movements with an Engine ID of 2 will be created in this very physical world.
    • Display factor
      The Box2D engine works with meters and kilograms. Clickteam Fusion 2.5 frames work with pixels. This property contains the multiplication factor to apply to Clickteam Fusion 2.5 coordinates when transfering them into the physical world. A value of 32 means that a 32 pixel-wide object will have a width of 1 meter in the world.
      The value of 32 works for the majority of the games you can create. But if your game contains very big objects, the physical engine may not be able to cope with them. You should therefore, change this value depending on the size of your objects. A higher value reduces the size of the objects in the physical world. A smaller value increases them.
      Also note that, as a result of the calculation, objects will seem to move faster on the frame with lower values of this property.
    • Velocity iterations
      This property is used to define the depth of the processing of the physical engine. The engine works by evaluating the collisions of the different objects in a number of passes. The more passes, the more precise the result of the calculations is. But also the slower the engine is.
      The default value of 6 should be sufficient for the majority of games. But if, in your game, you see some objects flicker or not being precisely where they are supposed to be, you should increase this value. Please note that this will exponentially slow down the engine.
      You can, for example, set this property to a higher value, which will cause a better calculation of the position of the objects at the start of the frame, time for the piles of objects to stabilize themselves, and later set it back to a lower value with the “Set iterations” action during the game.
    • Position iterations
      This property is similar to the previous one, and affects the calculation of the position of the objects in the physical world. The default value of 2 should be sufficient for the majority of games, but you can also increase it if you find the engine not to be precise enough. The higher the value, the slower the engine will be, so the choice of a correct value has to be the result of practical evaluation.
The Conditions

This object does not contain any specific condition.

The Actions
  • World
    • Add object to world
      The Add object to world action allows you to insert non-physical objects (like an active object with a simple Path movement) in the physical world. The position of the object in the physical world will be forced at every frame, so the object will push all the real physical objects it will encounter in the world.
      This feature allows you to use the Path movement in the world : you might need for a platform game, some ennemies like guards that move from left to right. Just program them with the normal, non-physical Path movement, and add them to the world.
    • Remove object from world
      This action will remove an object that has been added to the physical world. It does not destroy the object, the object will stay active in the non-physical world.
    • Set gravity force
      This action changes the current gravity in the world. A value of 10 (exactly 9.81) is identical to the earth gravity. A gravity of 0 will make all your objects float in the air.
    • Set gravity angle
      This action changes the angle of the gravity. The angle is expressed in degrees (from 0 to 360). All the objects of your world will instantly react to a change in the angle.
    • Set iterations
      Changes the precision of the engine by setting the number of iterations performed by the engine. The first parameter is the number of velocity iterations (default value is 6), and the second parameter is the number of position iterations (default value is 2). Please read the things to know section of the physics chapter in the Objects / Common Properties section for information on when to use this action.
  • Objects
    You can, from the Physics – Engine object, change the density, the friction, the gravity scale and the elasticity of the objects. All these options are contained in the “Objects” sub-menu.
  • Joints
    Clickteam Fusion 2.5 allows you to create various type of joints supported by Box2D. You must provide a name when you create a joint, as this name will be used for future references to the joint.

    • Distance joints
      The distance joint is a simple joint which says that the distance between two points on two objects must be constant. When you create such a joint, the two bodies should already be in place.

      • Joint two objects at hot spots
        Creates a distance joint at the location of the hot spot of the two objects. Once created, the distance between the two objects will remain constant (unless you really force the joint by applying strong forces to the object).
      • Joint two objects at action point
        Creates a distance joint at the location of the action points of the objects.
      • Joint two objects at position
        Creates a distance joint at the given coordinates within the objects. The values of the offsets are added to the location of the hot-spot of the objects.
      • Set joint elasticity
        Makes the joint between the two objects behave like a spring. This action awaits two parameters : the first one is the frequency of the spring, expressed in Hz. A value of 10 will make the spring bounce 10 times per second. You should not enter values above 30 (for a 50 FPS application). The second parameter is the damping factor, a value from 0 to 100 : use 0 and the spring with oscillate forever, 100 and it will stop instantly.
    • Revolute joints A revolute joint forces two objects to share a common anchor point, often called a hinge point. The revolute joint has a single degree of freedom: the relative rotation of the two objects.
      • Joint two objects at hot spot
        Creates a revolute joint at the location of the hot-spot of the first object. Once created the objects will turn around their axis and wont separate themselves.
      • Joint two objects at action point
        Creates a revolute joint at the location of the action point of the first object. Once created the objects will turn around their axis and won’t separate themselves.
      • Joint two objects at position Creates a revolute joint at the given coordinates within the first object. The values of the offsets are added to the location of the hot-spot of the objects.
      • Set joint angle limits
        This action allows you to constrain the rotation of the second object to a specific area of angle. It expects two parameters, the lower angle (a value expressed in degrees, from 0 to 360) and the upper angle (expressed in degrees, from 0 to 360). The limits will be removed if both values are equal to 0.
      • Set joint motor
        Allows you to start a motor that will make the second object rotate. This action awaits the torque of the motor as first parameter, a value from -250 (counter-clockwise rotation) to 250 (clockwise rotation), and the speed of the motor as second parameter, a value from 0 to 100.
    • Prismatic joints
      A prismatic joint allows the relative translation of two objects along a specified axis. A prismatic joint prevents relative rotation. Therefore, a prismatic joint has a single degree of freedom.

      • Joint two objects at hot spot
        Creates a prismatic joint at the location of the hot-spot of the two objects. Once the joint is created, the objects will stay in the same axis.
      • Joint two objects at action point
        Creates a prismatic joint at the location of the action point of the two objects.
      • Joint two objects at position
        Creates a prismatic joint at the given coordinates within the objects. The values of the offsets are added to the location of the hot-spot of the objects.
      • Set joint translation limits
        This action allows you to restrain the movement of the objects to a specific portion of the axis. The first parameter is the lower limit, expressed in pixels from the position of the first object, and the second parameter is the higher limit, also expressed in pixels from the first object.
      • Set joint motor
        This action creates a motor that moves the second object away (or toward) the first object. The first parameter is the force of the motor, a value from -250 (object get closer) to 250 (objects move away from each other). The second parameter is the speed of the motor, a value from 0 to 250.
    • Pulley joints
      A pulley is used to create an idealized pulley. The pulley connects two objects to ground and to each other. As one object goes up, the other goes down.

      • Joint two objects at hot spot Creates a pulley joint at the location of the hot-spot of the two objects. You must indicate the length (in pixels) and angle (in degrees, from 0 to 360) of the ropes attached to the two objects. Once the objects are created, they will be linked together by an invisible rope. The last parameter is the transmission ratio, a value from 0 to 100.
      • Joint two objects at action point Creates a pulley joint at the location of the action point of the two objects. As for the previous action, you must indicate the length (in pixels) and angle (in degrees, from 0 to 360) of the ropes attached to the two objects. The last parameter is the transmission ratio, a value from 0 to 100. If you use, for example, a value of 50, the second objet will move at half the speed of the first object.
    • Destroy joint
      This action destroys a previously created joint. The objects will be allowed to move freely afterwards.
The Expressions
  • Gravity
    • Angle
      Returns the current angle of the gravity, expressed in degrees (from 0 to 360).
    • Strength
      Returns the current strength of the gravity, expressed in meters per square seconds.
  • Iterations
    • Velocity iterations
      Returns the current number of velocity iterations.
    • Position iterations
      Returns the current number of position iterations.
  • Distance joints
    • Frequency
      Returns the joint’s elasticity frequency in Hz, as set in the “Set elasticity” action.
    • Damping
      Returns the joint’s damping factor, a value from 0 to 100, as set in the “Set elasticity” action.
  • Revolute joints
    • Lower angle limit
      Returns the joint’s lower angle limit, a value expressed in degrees, as defined in the “Set angle limit” action.
    • Upper angle limit
      Returns the joint’s upper angle limit, a value expressed in degrees, as defined in the “Set angle limit” action.
    • Motor strength
      Returns the joint’s motor strength, a value from 0 to 100, as set in the “Set motor” action.
    • Motor speed
      Returns the joint’s motor speed, a value from 0 to 100, as set in the “Set motor” action.
  • Prismatic joints
    • Lower translation limit
      Returns the joint’s lower translation limit, a value expressed in pixels, as defined in the “Set translation limit” action.
    • Upper translation limit
      Returns the joint’s upper translation limit, a value expressed in pixels, as defined in the “Set translation limit” action.
    • Motor strength
      Returns the joint’s motor strength, a value from 0 to 100, as set in the “Set motor” action.
    • Motor speed
      Returns the joint’s motor speed, a value from 0 to 100, as set in the “Set motor” action.