Trouble with jumping AI...

This forum is currently in read-only mode.
From the Asset Store
Jumping in space is a game where you jump to the other asteroids at the right time and catch the star whenever possible.
  • I've searched around for awhile on several occasions and I couldn't find anything that really helped me out... So I have a question- how can I get my AI to work with more than 1 instance of an enemy object?

    Heres the problem- I have a bird enemy that jumps towards the player when he's 100 pixels close. I have that working the way I want, but I can't have more than 1 doing it at the same time... If I don't use for each object, they both jump regardless of their position relative to the player character, but if I do, only 1 bird will jump at a time. Is there anyway I can get around this? Yes, I saw the tutorial on "For Each", but I've tried several ways of using that condition.

    I've done it with a plain "For Each Object", one with "For Each Object Ordered" going my object.count, and I tried "For Each Object" with a condition that checks to see if the objects "active" private variable is equal to 1(1 = active were 0 = deactive). I'm kind of lost here...

    Heres my cap:

    http://dl.dropbox.com/u/20855857/BabyMa ... ouble..cap

    Z-Jump

    X- Shoot

    *Bullet range depends on the stamina bar located beneath the health bar*

    Also you can hit backspace for the current time according to your computer's clock...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try using the 'Enemy' family, which you already have set for the bird enemy. I changed a few events to use the family instead of the individual object, and the second bird enemy you have started working accordingly.

    Screenshot showing both birds jumping and the portion that I changed.

    http://img638.imageshack.us/i/unledyw.png/

  • Woah dude, thanks for the help! I would of never thought to use a family for the jumpin...

    It's a step in the right direction, but the other bird still jumps regardless of being 100 pixels close to the player... I'm not sure whats up with it! Maybe I'm not looking close enough at your changes... It's kind of cute, but maybe for another enemy, like some twin frogs.

    Thanks again for the help! Any ideas on how to fix this? In the mean time I'll keep fiddling with it...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)