Differences

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

Link to this comparison view

Both sides previous revision Previous revision
gdevelop5:behaviors:events-based-behaviors [2019/05/08 19:00]
wendigo fix spelling
gdevelop5:behaviors:events-based-behaviors [2019/05/11 14:23] (current)
ddabrahim Added Collaboration to the list of advantages and improved(?) explanation of the other two..
Line 93: Line 93:
 ## A word about the advantages of behaviors ## A word about the advantages of behaviors
  
-Creating your own behaviors has two main advantages:+Creating your own behaviors has multiple ​advantages:
  
-* *Encapsulation*:​ by adding logic inside a custom behavior, you can keep a clear events sheet, with less events so it's easier to read. The behavior ​can have actions/​conditions ​or expressions that run logic, so you don't have to repeat ​things ​in the events sheet. You just use the action/​condition like any other. +* *Encapsulation*:​ by adding logic inside a custom behavior, you can keep a clear events sheet, with less events so it's easier to read and maintainBehaviors ​can have actions/​conditions ​and expressions that run logic, so you don't have to repeat ​long instructions ​in the events sheet. You can just use the action/​condition ​the behavior providing ​like you would normally do with any other behavior
-* *Reusability*:​ let's say that you created a behavior to have an enemy move and lose life if hit by the player. If you want to create a slightly different enemy, but working ​the same, you can create a new object, then add the same behavior. In a few clicks, you'​ll ​have a working ​enemy.+* *Reusability*:​ let's say that you created a behavior to have an enemy move and lose life if hit by the player. If you want to create a slightly different enemy, but based on the same principles, you can create a new object, then add the same behavior ​with different properties. In a few clicks, you can have a new enemy in your game. 
 +* *Collaboration*:​ let's say you are working in a team or would like to make your project open-source and invite people to contribute with new features and gameplay. Custom behavior make it possible for anyone to design and create self contained features and game logic that we can easily import in to a project and used by anyone without prior knowledge required including level and game designers who don't normally work on game logic or at least prefer not to.
  
 <​note>​Encapsulation and reusability are core concepts in programming. In other game engines, like Unity, objects and behaviors might be named entities and components.</​note>​ <​note>​Encapsulation and reusability are core concepts in programming. In other game engines, like Unity, objects and behaviors might be named entities and components.</​note>​