Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:events [2020/12/19 23:15]
yu-tang [TimeDelta] 1800->18000
gdevelop5:events [2021/11/22 23:06] (current)
Line 27: Line 27:
 Events are made up of _conditions_ and _actions_. Events are made up of _conditions_ and _actions_.
  
-Conditions are what cause something to happen. Some examples of conditions include the player colliding with another object or a variable equalling a certain value. If an event doesn'have a condition, the associated actions run in every frame of the game.+Conditions are used to trigger _when_ an action should happen and also to select _which_ objects are affected by the actions of the event. For instance, a condition can check when the player is colliding with another object.  In this case, the actions in the event will only take place when the objects are touching each other and they will only affect the objects that are colliding. 
 +  
 + <note>If an event does not have any conditions, the associated actions will run every frame of the game (usually 60 times per second).</note>
  
-Actions are the things that happen when a condition is true. Some examples of actions include deleting an object or incrementing the value of a variable. Without actions, events don't do anything.+Actions are the things that happen when all conditions are true. Some examples of actions include deleting an object or incrementing the value of a variable. Without actions, events don't do anything.
  
 Events can have multiple conditions and multiple actions. For example, an event might have a condition that checks if the player is jumping _and_ is colliding with an enemy object, and an action that deletes the enemy object _and_ increments the player's score. Events can have multiple conditions and multiple actions. For example, an event might have a condition that checks if the player is jumping _and_ is colliding with an enemy object, and an action that deletes the enemy object _and_ increments the player's score.
Line 37: Line 39:
 ## Execution order ## Execution order
  
-Events run in the order they're definedThis can have a significant effect on what happens when an event is executed.+Events run in the order they are listed from top to bottomThe order of events can have a significant effect on what happens when an event is executed.
  
-For example, the following events create a "Square" object and then immediately deletes the object: +If an event is causing an unintended side-effect, verify that events listed higher in the event sheet aren't impacting events defined later in the frame.
- +
-{{ :gdevelop5:tutorials:delete-square.png?nolink |}} +
- +
-As a result, the "Square" object is never displayed displayed on the screen. +
- +
-If an event is causing an unintended side-effect, verify that events defined earlier in the frame aren't impacting events defined later in the frame.+
  
 ## TimeDelta ## TimeDelta
Line 100: Line 96:
  
 - The conditions of the parent event are true. - The conditions of the parent event are true.
-- The actions of the parent event have finished running.+- The actions of the parent event have been processed.
  
 To add a sub-event to an event: To add a sub-event to an event: