You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/gdevelop5/behaviors/events-based-behaviors/index.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,9 @@ Behaviors are grouped into [extensions](/gdevelop5/extensions). They are the sam
31
31
32
32
Click on **Create or search for new extensions** at the bottom. Then, select **Create a new extension** to [create a new extension](/gdevelop5/extensions/create).
33
33
34
-
By default, extensions don't have any behavior. Add one by clicking on **Add a new behavior**on the left.
34
+
By default, extensions don't have any behavior. Add one by clicking on the "+" button on the left next to **Behaviors**.
You can choose the description and the name to display to users when they will add your behavior to an object. If you need to use a specific object (sprites, texts...), you can choose it with the drop-down list at the bottom.
39
39
@@ -161,6 +161,18 @@ If you create a behavior and want to use this, just go to the properties of this
161
161
162
162
To use a behavior based on another, you don't need to do anything special! Just add it to your object as usual: any missing behavior will be added to your object, so you can start using it immediately.
163
163
164
+
## Write behaviors dedicated to your project
165
+
166
+
You probably used extensions from the community. These extensions aim to be usable in many projects, but extensions can also be created with only one project in mind.
167
+
168
+
The [platformer template](https://gdevelop.io/game-example/free/platformer) has a `Enemy` extension with a `MonsterEnemy` behavior. This behavior toggle between
169
+
- a **Fire** state where it hurts the player
170
+
- a **NoFire** state where the player can jump on it
171
+
172
+

173
+
174
+
The [Bomberman-like template](https://gdevelop.io/game-example/free/3d-bomber-bunny) shows how a game can be organized into extensions. The players, bombs and bonuses have their own custom behavior. It allows to gather the logic of each object in one place: their extension. The main events can then focus on how these objects interact with each other.
175
+
164
176
## A word about the advantages of behaviors
165
177
166
178
Creating your own behaviors has multiple advantages:
@@ -175,6 +187,11 @@ Creating your own behaviors has multiple advantages:
175
187
176
188
## Examples/ideas for custom behaviors
177
189
190
+
Installing and opening existing extensions can be a good way to see how behaviors work. The following extensions are simple enough not to feel lost when looking at their events:
191
+
192
+
-[Animated back and forth movement](https://wiki.gdevelop.io/gdevelop5/extensions/animated-back-and-forth-movement/)
0 commit comments