Clickteam Fusion, the successor to Multimedia Fusion 2, has a built-in physics engine based on the Box2D engine. This new engine may be slightly overwhelming to new users of Box2D so a reference guide and workable examples have been created to help users with the physics engine in Clickteam Fusion.
What you'll need
As mentioned above, Clickteam Fusion comes with a built-in physics engine based from Box2D. This physic engine extends many pre-existing capabilities of some Clickteam Fusion features, such as object movements, and introduces new features, such as joints between objects, in an easy-to-implement system.
Listed below are a few of the basic information recommended to provide a good start on how to use the Clickteam Fusion physic engine.
The Physics Engine Object is the most important part of Clickteam Fusion's physic engine. This object is required on any frame which has physic objects or physic movements. This object determines how all other physic-related objects behave.
One feature of the Clickteam Fusion physic engine is the ability to create multiple physic worlds within one frame. As such, the need to differentiate between Physic Engine objects is crucial. All physical objects, joints, and movements are attached to a specific Physics Engine via the "Engine ID." This ID is a simple integral number assigned during edittime. Avoid mismatching Engine IDs to ensure accurate physic movement.
There are many terms associated with the Clickteam Fusion physic engine. Some terms, such as density and gravity, you may know while other terms you may not, such as torque, impulse, and elasticity.
Click the various tabs to read a bit more information about each physic term.
In Clickteam Fusion, density is closely synonymous with mass. Density determines how easily an object moves. Objects with a high density need much more energy to alter their path as opposed to objects with low density.
Conceptually, imagine attempting to catch a free falling bird's feather and a free falling bowling ball. The feather easily stops while the bowling ball may hit the ground and take you with it! This same logic applies to objects in Clickteam Fusion.
Mathematically, force is mass * net acceleration. In Clickteam Fusion, forces can cause objects to accelerate, rotate, bounce, and various other actions. Generally, forces will be the major reason why objects move.
One important example of force at work is the Fan Object as compared to the Treadmill Object. The Fan Object applies a continuous force to overlaying objects while the Treadmill Object simply moves overlaying objects. Put in another way, the Fan Object affects velocity while the Treadmill Object affects position.
Torque is a rotational force. When torque is applied to objects, the objects rotate. In Clickteam Fusion, torque can be assigned a positive strength for clockwise rotation and a negative strength for counter-clockwise rotation.
Gravity is the constant force upon an object from an outside object such as the Earth's pull on plants. Clickteam Fusion's gravity works identical to real world physics. The direction and strength may be changed as well as its influence over individual objects via the "Gravity Scale" property located within physic movements.
In Clickteam Fusion, impulse is a force applied over a period of time. Similar to force, there are linear impulses and rotational impulses. Impulse can be used to simulate gravity, magnet attraction/repulsion, and other similar forces.
In real world physics, objects with translational motion and rotational motion produce rolling behaviors. This type of behavior can be adjusted as necessary in Clickteam Fusion with the friction property. Objects with a friction of 0 will not roll while objects with a friction of 100 will roll rapidly.
In Clickteam Fusion, elasticity represents the percentage of the energy kept after a bounce. Generally speaking, elasticity can be thought of as a percentage. 0 elasticity means the object does not bounce while 100 elasticity represents the object will bounce without loss of energy. This will cause the object to bounce indefinitely.
Joints are invisible points where two or more objects are connected to each other. There are numerous everyday examples of joints such as fans and axis systems. In Clickteam Fusion, there are 4 types of joints; distance, revolute, prismatic, and pulley. Each of these joints has their unique properties and usages.
Click on the various tabs to learn specific details about joints.
Distance Joints are joints where the attached objects remain a fixed distance from one another. Essentially, the objects are attached to each via an invisible rigid pole similar to a car's wheels and the axis between them.
Whereas Distance Joints maintain a fixed distance, Revolute Joints attach the specified objects to an invisible anchor point. Objects then rotate around this anchor point freely or restrictively. Examples of everyday revolute joints are fans, revolving doors, and doors that swing on hinges. This joint has a dedicated extension, called the Physics Joint Object, which can create Revolute Joints during runtime.
Prismatic Joints allow the affect objects to move along a specified axis without any kind of rotation. Examples of prismatic joints are ziplines, slides, a person tightrope walking, and a person climbing a ladder.
Pulley Joints are joints which create a pulley system from two objects. As one objects moves up, the other object moves down. Generally speaking, the total distance of each object's "rope" is fixed. Examples of pulley joints are ... pulley systems.
As previously mentioned in the introduction, Clickteam Fusion added new features in conjunction with the physic engine; one of which are 9 new physic-based movements. Some movements, such as the 8 Directions and the Platform Movement, use the incorporate existing movements with the physic engine while others, such as the Spring, are entirely new movements.
Click the various tabs to view specific details about these movements.
The Physics 8 Directions movement allows an object to move in 8 (or 4) direction while allowing interaction with a frame's physical world. As opposed to the non-physical 8 Directions movement, this movement produces turns which have acceleration. This movement is a player-controlled movement.
The Axial movement allows objects to move along an invisible axis. Objects with this movement behave extremely similar to classic pendulums.
The Physics Background movement is reserved for objects which do not move. Objects with this movement only push other objects. Common items which might use this movement are the ground, walls, and floating platforms.
The Bouncing Ball movement allows objects to bounce off other objects similar to pinball machines or Breakout-esque games. This movement is virtually unchanged from its non-physical counterpart.
The Physics Platform movement is one of the most prominent integration of the Clickteam Fusion physic engine into pre-existing features. This movement is a player-controlled movement. This movement allows the object to move linearly in a platform-like behavior. This movement contains several properties which allowing much customization for the object such as climbing speed, crouching speed, maximum jumps.
The Race Car movement allows objects to move in a racecar fashion whilst interacting with the physical world. This movement is virtually unchanged from its non-physical counterpart. This movement is player-controlled.
The Physics SpaceShip movement allows an object to behave like the ship from "Asteroids." This movement is a player-controlled movement though it is possible to manipulate the movement to behave without a player's input.
The Physics Spring movement is a new movement used specifically with the physics engine. This movement allows the object to propel other objects in a specified directions similar to any classic spring.
The Physics Static movement is the exact same as its non-physical counterpart. This movement is generally used to let objects interact with the physical world, but have no other movement behaviors, like rocks, gravel, or special effects.
In summary, the Clickteam Fusion physic engine has a ton of different objects which help create the physic world. From movements to joints, you should be basically aware of all these objects to best use the entire engine.