Tuesday, December 1, 2009

Stay on target...



Just a little quick one. Here we have a "seeker" movie clip that is constantly on the hunt for those delicious little green orbs. It will turn to face the nearest one (or the one it's currently chasing) via some trigonometry. The chasing is nothing too incredibly complex. There's an invisible hit box surrounding the seeker and when it hits a green orb, the seeker's change in coordinates is based off of where the orb is relative to the seeker.

You may notice the seeker has a preference for one of the orbs. I believe that if both orbs are within sight, the seeker goes after the one it is currently chasing. I have seen it do an about-face to chase the other orb, but I think that's because I've put in a cool down period for the chase. In other words, if the hit zone ISN'T hitting the green orb, the seeker will still give chase for a half second. During this cool down period (invisible to the viewer), the seeker can freely change targets if one is available.

1 comment:

  1. This screams "flash game!!" I think this is my fav post of yours thusfar. It started a dept conversation about seekers.

    ReplyDelete