Control only 1 bullet

Hello,
I finally figured out how to shoot bullets how I want for my platformer. It's almost perfect except for one detail.

I am using the swipe angle to determine the direction the bullet goes. The problem is if I fire two bullets in quick succession the first bullet will change it's angle to match that of the second. Example, I fire the first bullet at 75 degrees. I quickly fire the second bullet at 190 degrees. The first bullet will then change course and go at 190 degrees. I would like the first bullet to continue at 75 degrees.

Here is how I have it set up:
vector to angle sets a game attribute shootAngle based on mouse press and mouse release
bullet spawns on mouse release
bullet accelerates at direction game.shootAngle

Hope that makes sense. Thank you for any help you can give me.

Comments

  • LumpAppsLumpApps Member Posts: 2,881
    First make an attribute in the bullet actor named bulletangle.
    Then on release do the vector to angle but store it in this self.bulletangle and then accelerate to this self.bulletangle.
    Hope that helps.
  • PolishedGamerPolishedGamer Member Posts: 3
    Thanks for the help! Still doing the same thing though... :(
    I'll have to experiment some more.
  • VolontaArtsVolontaArts Member Posts: 510
    edited September 2013
    try giving each bullet actor its own iD

    you do this by making 2 attributes... in the game attributes one ActorAdd (or whatever you want) and the other ActoriD in the actors self attributes

    Drag in to change attributes into the bullet actor in empty area....

    1. game.ActorAdd = game.ActorAdd+1
    2. self.ActoriD = game.ActorADD

    ps my computer froze like 10 times trying to write this comment...had to keep saving and editing lmao.
  • VolontaArtsVolontaArts Member Posts: 510
    did this work?
  • PolishedGamerPolishedGamer Member Posts: 3
    It didn't work, but I figured out another solution. I changed 'accelerate' to 'change velocity'. Thank you all for helping though. This forum is great.
  • VolontaArtsVolontaArts Member Posts: 510
    cool, nice work
Sign In or Register to comment.