How do I make each copy of a bullet that is created to be separate from its copies?

0 favourites
  • 4 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • I'm currently making a character that has a familiar flowing them and if the player shoots a bullet and it goes through this familiar, the damage will be doubled, however the damage will multiply with each time a bullet hits this familiar cause the weapon to do very high damage if the player keeps shooting through the familiar.

    Is there a way to make each copy of a bullet that is spawned to work independently from each other so that the multiply will increase the damage that goes through the familiar whilst keeping the damage the same for every other copy of that bullet?

    I don't want to use clamp as there are different multipliers that can affect the weapons damage output.

    I also don't want to create a separate variable for each weapon (for if the bullet connects with the familiar) as the more multiplies I have the more new variables I'll need to create.

    Any advise is much appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The bullets are automatically separate, maybe the problem is that you've assigned damage to the weapon and not the bullets even though the bullets sound more important. What logic have you used to deal damage to the enemy from a bullet?

  • No, I used the weapon as the centre point for all the variables like fire rate, range damage etc(mainly to make it easier to balance). I did manage to fix it by adding another variable and multiply it by a multiplier (for balancing reasons), at the start of layout if set character is picked and set values back to normal when end of layout, however this will become a much larger issue if I keep doing this as each weapon will have way too many variables.

    Despite it being 'somewhat fixed' I would like to figure out a way to split copies of the same enemy, bullets sprites etc...

  • Yeah two variable sounds good because you would use one for the normal damage, and if bullet collides with that target then apply damage from the second variable.

    Have you tried using global variables? You can have one for equipped weapon, damage, rate of fire etc. Then in events you change the variable values based on equipped weapon rather than use instance variables on the objects.

    Not sure what you mean about splitting enemies, can't see how the game works so it's difficult. In general though you should be able to do what you want with events.

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