Having trouble with Behaviors

scjohnson243

  • Posts: 6
Hi all - Just getting started in Stencyl - I have a oracle programming background (never an expert, but always trying!)

I am having a problem figuring out where to put behaviors - I have read over the tutorials over and over, but for some reason its still not sinking in - I have been thinking of them as classes in other Object oriented languages(the little I know) But for some reason I just cant keep them in the right places.

For example

A basic tower defense game, I have a tower, bullet and enemy actors

Enemy walks along a set path (walking behavior attached to enemy - would also keep track of things like speed, hit points, etc - things specific to only this actor, right/)

Tower will have things like the range, attack speed?

Bullets would have damage, flight speed, special effects (SLow, AE, etc)

is that correct?  So for this example, I tie bullet damage to the bullet - it does 5 damage, it hits the enemy and I would take off 5 hit points from the enemy actor, right?  How do I tell the damage from the bullet to talk to the hp of the enemy actor?

ugh.. I keep confusing myself - Does anyone have any good advice with how to keep this separated? I am trying Publishers tower defense tutorials and I keep getting myself lost... Any advice, links, tips would be appreciated.

rob1221

  • *
  • Posts: 9472
You can communicate between behaviors using the blocks under the Behavior category to either trigger events or get/set attributes.  Other methods you can use are game attributes and custom blocks.