Encapsulation

NRafNRaf Member Posts: 4
edited November -1 in Working with GS (Mac)
Is there some way to create the programming equilavant of a function / method in GameSalad? At the moment, I can use behaviors however there's no way to create one behavior, as far as I know, and use it in multiple places, change it and have all the places using that certain behavior to update.

Also, on the topic, is there any way to delete behaviors after creating them?

Comments

  • rebumprebump Member Posts: 1,058
    Not really unless you make a single "(scene) controller actor" and use some game attributes for the in and out variables and another game attribute or two for controlling communication (i.e. think lock or better, semaphore). This can get messy and be timing sensitive if not done right.

    You can create rules/behaviors in an actor prototype and it then shows up in each instance of the actor that you place/spawn in a scene. Then you can also edit each placed actor instance if need be.

    Rules/behaviors/timers should be deletable. There is an "x" delete item on each one. You can also highlight it and press the 'delete' key. If you are talking about the "My Behaviors" area, no, not currently (unless they added it to 0.8.x since I am waiting a few more days for the fallout before I upgrade to 0.7.0).
  • ORBZORBZ Member Posts: 1,304
    Inheritance is what you want & no it's not supported :(

    Banana isa Fruit.

    Work around: bools lots of them.
Sign In or Register to comment.