How do I create multiple killer bats

0 favourites
  • 5 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • Hi,

    Using some pretty basic code to get a killer bat to MoveTo my Player, and it works, but it will only work for 1 bat. I have multiple copies of the bat on the screen but only the first, original bat will move. I'd like all Bats to do the same movement. Here's my code:

    Here's the Player in the Bat Cave:

    Any thoughts/suggestions greatly appreciated!

    thanks,

    M

  • This work well for me :

    Can you provide a .capx ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nice, this works for me as well, thanks.

    I changed the speed to 1 and they flock to the Player as he goes by. Also added Solid behaviour so the Player can bump against them.

    Wondering now how I can give each Bat a different speed. Would an Instance Variable be the right tact? Create a Speed variable... but how to specify each Bat with it's own speed.

  • Welcome to the wonders of "instance picking". Search for it in the forums, tutorials, and manual.. lots of stuff on it.

    TL;DR... you have to find a way to tell construct2 to "pick" the bat instances individually so it knows which ones to act on. This can be done many ways.. I would think in your version it would be best to use the instance variable for speed and then set it "On Create" of each instance to a random number... or if you wanted more realistic bat action you could simpy have a randomizing event that runs in the back ground choosing a random instance of "bat" and changing its speed to a random value every X seconds...

  • Interesting, thanks for the info, I'll start digging around. Yes, like the idea of a random speed change every X seconds.

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