Common conditions/actions for all objects

Before moving on with the conditions/actions, make sure you go through the basic game making concepts and common features to all objects.

Objects

Pick a random object: When this condition/action is set, a random instance of the chosen object will be picked. After setting this, all the other conditions and actions set for this event will be applied only and only for that instance of the object.

Pick all objects: When this condition/action is set, all the instances of the chosen object will be picked. After setting this, all the other conditions and actions set for this event will be applied for all the instances of that object.

Number of objects: Counts how many instances of the specified object are currently picked, and compares that number to a value. If previous conditions on the objects have not been used, this condition counts how many of these objects exist in the current scene.

Pick nearest object: This condition will pick the instance of the object that is nearest to the specified position. After setting this condition, all the other conditions and actions set for this event will be applied only and only for that instance of the object.

Create an object: This action creates an instance of the specified object at the specified position and in the specified layer.

Create an object from its name: This action creates the object with the specified name in the group specified. The object will be created at the specified X and Y positions and the chosen layer. Make sure to surround the object name with quotes.

Raycast and collision

Collision: This condition will check if there is a collision between the selected objects, i.e. if the selected objects are in contact with each other. If the object chosen has collision masks, the condition checks collision while considering collision masks.

Raycast: This action sends a virtual ray (think of it as a ray of light) at the specified angle from the specified position, intersecting the closest object within the specified distance. Only and only the intersected object will be taken into consideration. When the condition is converted, the object farthest from the specified position within the specified distance is taken into consideration.

Raycast to position: This actions sends a virtual ray to the specified position from another specified position, intersecting the closest object within the specified distance. Only and only the intersected object will be taken into consideration. When the condition is inverted, the object farthest from the specified position within the specified distance is taken into consideration.

Point inside object: This condition returns true only when the specified point is inside the chosen object's collision masks.

Position

Distance between two objects: This condition compares the distance between the two objects. When the distance is less than the value entered in the “Distance” field, the condition returns true and the corresponding actions are performed. When the condition is inverted, the condition returns true when the distance between the objects is greater than the value entered in the “Distance” field.

Compare X position of an object: This condition compares the X position of the selected object to the specified X position.

Compare Y position of an object: This condition compares the Y position of the selected object to the specified Y position.

Put an object around an object: This action positions the object name specified in “Object” field, at the specified distance and angle from the object name in ““Center” object” field. For positioning one object with respect to the other, their center's coordinates are used.

Put an object around a position: This action positions the object name specified in “Object” field, at the specified distance and angle from the position entered using the “X position” and “Y position” field. The center of the object is used for positioning it.

X position of an object: This action modifies the X position of the specified object.

Y position of an object: This action modifies the Y position of the specified object.

Position of an object: This action modifies the position of the specified object using the “X position” and “Y position” and “Modification's sign” for both of them.

Separate two objects: This action moves an object away from another using their collision masks.

Angle

An object is rotated toward another: This condition checks if the object specified is rotated toward the other specified object such that the tolerance (difference in angle) is within the value entered in the “Angle of tolerance, in degrees” field. The minimum tolerance can be 0 degrees, in which, the object will be rotated in the direction of the second object with no angle difference.

Angle: This condition compares the angle of the specified object to the angle entered in the “Value to compare (in degrees)” field.

Rotate: This action rotates the object with the specified angular speed. If the angular speed is positive, the object rotates clockwise and if the angular speed is negative, the object rotates counterclockwise.

Rotate toward angle: This action rotates the object towards the specified angle with the specified angular speed. If the angular speed is positive, the object rotates clockwise and if the angular speed is negative, the object rotates counterclockwise. If the speed is 0, the object immediately rotates to the specified angle.

Rotate toward position: This action rotates the object such that the object faces the position specified using the “X position” and “Y position” with the specified angular speed. If the angular speed is positive, the object rotates clockwise and if the angular speed is negative, the object rotates counterclockwise. If the speed is 0, the object immediately rotates and faces the specified position.

Angle: This action changes the angle of rotation of the specified object.

Movement

An object is moving toward another: This condition returns true if the object name specified in “Object” is moving toward the object specified in “Object 2” and the tolerance (difference in angle) is less than the value entered in “Angle of tolerance” field.

Angle of movement: This condition returns true if the object specified is displaced toward the angle specified in “Angle, in degrees” and the tolerance (difference in angle) is less than the value entered in “Tolerance” field.

Object is stopped: This condition returns true if an object specified is stopped, i.e. it does not move at all.

Speed: This condition compares the speed of the object to the value entered in the “Speed” field.

Apply movement to all objects: This action moves all the movements according to the forces they have. This action is called at the end of the events by default.

Add a force (angle): This action adds a force on the object. The magnitude of the force is set using the “Speed (in pixels per second)” while its direction is set using the angle to which the force is to be applied.

Add a force to move toward an object: This action adds a force on the specified object in which the direction is set using “Target object” that adds a force to the object towards in the direction of the second object. The magnitude of the force is set using “Speed (in pixels per second)”.

Add a force to move toward a position: This action adds a force to the object in the direction of the position entered using the “X position” and “Y position” fields. The magnitude of the force is set using “Speed (in pixels per second)”.

Add a force: This condition adds a resultant force based on the forces entered in the X and Y directions.

Stop the object: This condition stops the object by deleting all the forces, i.e. the net force on the object after performing this action is 0.

Behaviors

Behavior activated: This condition checks if the specified behavior is activated for the chosen object.

De/activate a behavior: This action activates/deactivates a behavior associated to an object. To deactivate a behavior, choose the “No” option for “Activate?”.

Layers

Compare layer: This condition checks if the object chosen is in the specified layer.

Layer: This action moves the object to the specified layer.

Timers

Value of a timer: This condition tests the elapsed time of the specified object timer against the value entered in “Time in seconds” field.

Timer paused: This condition checks if the specified object timer is paused.

Pause a timer: This action pauses the timer of an object.

Delete a timer: This action deletes the timer of an object.

Start (or reset) a timer: This action starts the timer of an object. If the timer has already been started, this condition resets the timer to 0.

Unpause a timer: This action unpauses the timer of an object if it is paused.

Variables

Child existence: This condition checks if the specified child of the variable exists.

Value of an object's variable: This condition compares the value of a variable of an object to the value in the “Value to compare” field.

Text of an object's variable: This condition compares the text of a variable of an object to the text in the “Text to compare” field.

Modify a variable of an object: This action modifies the value of an object's variable.

Modify the text of a variable of an object: This action modifies the value of an object's variable.

Clear variable: This action clears the object variable by clearing all the children from the object variable.

Clear a child: This action clears the specified child of the specified object variable.

Z order

Compare Z order: This condition compares the Z order of the object specified to the value entered in “Z order” field.

Z order: This action modifies the value of the Z order of the specified object based on the “Modification's sign”.

Visibility

Visibility of an object: This condition returns true if the object specified is visible. When inverted, this condition returns true when the object is not visible.

Hide: This action hides the object, i.e. turns off its visibility.

This action does not delete the object. All the other conditions and actions will act just like they're supposed to.

For example, if there is some action to be performed on the collision of Object1 and Object2, it will still be performed even if Object1 is not visible.

Sometimes, you might not be able to see the object even though it is visible. In such a case, make sure to check the Z order of the object.

Show: This action shows the object if it is hidden, i.e. turns on its visibility.