Friday, March 16, 2012

Chain Stalker Class



A class I wrote that hooks up objects into a chain.
The chain has a tolerance and all objects try to maintain s set distance
away from it's target object (+-) the tolerance value.

In this example, there are 4 chains, the head of each chain being the
ball in the center that says "click+drag".
It kind of makes for a quick&dirty AI for enemies.

2 comments:

  1. Note To Self:
    If you are doing particle based explosions,
    why not do pixel based collision for collision
    detection?

    There could be an "explosion canvas"
    and all pixels on that canvas are explosive.
    You then sample the color of pixels on the explosion canvas that your sprite is on top of to see what it is colliding with.

    ReplyDelete
  2. Design wise it would be best to make SMALL sprites so there is less area to sample.

    ReplyDelete