Author Topic: Power tools 1.9 weapon help  (Read 997 times)

at0mix

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Power tools 1.9 weapon help
« on: Wed, Aug 1, 2012 »
Okay, so not to try and make it more complicated than it has to be, here's my question more than problem.

My friends and I are working on a game, and there are multiple enemies each with their own weapon, however, using the power tools weapon, every thing using a weapon needs a group for that weapon, so if I had say 20 enemies shooting, I'd have to make and add a group for each enemy, is there a simpler way of doing this than making many many groups?

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Power tools 1.9 weapon help
« Reply #1 on: Thu, Aug 2, 2012 »
The weapon can have it's "fire from" coordinates changed as much as you like, so there's no reason why all the enemies can't use one single weapon, they just make sure they 'fire from' their coordinates, not the base weapon coordinates.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

at0mix

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Power tools 1.9 weapon help
« Reply #2 on: Sun, Aug 5, 2012 »
Okay, but then I'm confused. Say my code has

Code: [Select]
if (FlxG.mouse.pressed())
{
baseWep.fireAtMouse();

}

but I also want to have the enemy shooting at me, if I put  like
Code: [Select]
if (distance < 150 && Registry.enemy.health > 0)
baseWep.fireAtTarget(Registry.player);

When I get close to the enemy, they only shoot when I'm not shooting.

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Power tools 1.9 weapon help
« Reply #3 on: Sun, Aug 5, 2012 »
You need 2 weapons, one for you, one for the baddies. You just don't need 1 weapon PER baddie.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

at0mix

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Power tools 1.9 weapon help
« Reply #4 on: Sun, Aug 5, 2012 »
But then wouldn't the same situation happen? Like, only one of them would be able to shoot at once?