The Daily Click ::. Forums ::. Klik Coding Help ::. Advanced Directional Calculator comparisons between more than one enemy and the player (bats for this one)
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
13th March, 2007 at 18:23:22 -

I'm using the directional calculator object and 4 bats in a room. The bats are all alseep on the ceiling. What it's supposed to do, is when Rovert gets within 50 pixels of a bat, it sets off a flag and the bat wakes up and attacks him. But what's happening instead is whenever Rovert gets near one bat (and the one bat only) they ALL wake up from everywhere in the room and attack. I've tried to do a fastloop for 4 rounds where I spread 0 to alt Variable Z and do "On loop BATS.. check the distance of Rovert in relation to the bat active object." But I still get the same effect.

There's a few instances where I do want this "all bats wake up" attack, like when Rovert hits the water and makes a loud splash to wake them at once, but for most of the bats in the game I want it to act like they wake up one at a time whenever he gets too close. I thought that by putting it in a fastloop it'd work but maybe I'm doing to comparison wrong?

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
13th March, 2007 at 18:36:33 -

Well, you could finagle with making the condition relative to the bat instead of the player (if you don't have it set up that way), but you might be better off with a value.

Set one of the bats' values (hopefully you've got one free) to the distance between the bat and the player, and then activate the bat when that value goes below a certain number. I don't know if it's inadvisable to use the direction calculator to get the distance for as many times as there are bats in a single action (which is what it will end up doing), but you should have no trouble finding the distance, one way or another.

But you shouldn't need loops for something this simple.

 
Go Moon!
   

Post Reply



 



Advertisement

Worth A Click