How do I fix my Bullet Hell mechanic?

0 favourites
  • 10 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hello folks,

    I'm trying to do a simple mechanic but I'm having problems. I'm trying to make an enemy fire 8 bullets that will stop almost immediately, then only 7 of those bullets will be randomly destroyed, and the one that is left alive will start moving again at its original angle.

    This is what is happening instead:

    i.gyazo.com/bc112ebf3d3e33e675db16125a80903c.mp4

    As you can see, sometimes no bullet survives the purge, other times more than one will make it, and none of them will follow its original angle (except those who have 0 or 180 as their angles).

    These are my events:

    I guess I'm overcomplicating stuff since I think this should be a really simple mechanic to achieve.

    What do you think?

  • The logic where you assign unkillable variable is just a bit wonky. You're saying compare for each bullet if its own IID is equal to an IID in a random range, this could be true any number of times or never. You should instead set a local variable to floor(random(0,8)) and then set the bullet whose IID matches that number.

  • Thank you lions_! I still have got to grasp this programming logic, it escapes me easily :P

    That fixed the issue with choosing which bullet survives. Do you have any idea why that bullet doesn't keep its original angle?

    It always goes either 0 or 180. That's why I stored their original angle into that instance variable (iniAngle), but still doesn't work, so I guess something's off.

  • If it continues at its current angle of motion then I see no reason to change the angle or add actions for angle when you set the special bullet?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah that's what I initially thought. It should continue at its current angle because I didn't touch anything related to their angles (except for the loopindex), but they all go either 0 or 180. That's why I stored their angles.

    __

    I've changed all the actions to "Set angle" instead of "Set angle of motion"

    and now it works only for SOME of the bullets, randomly. I don't know why.

    I've also double checked if there's any other event affecting the angles.

  • shameful bump.

    Does anyone have an idea why the bullets are not keeping their original angle?

    I recreated the same events and actions in a new blank game, without anything else, and still happens the same. The bullets won't keep their original angle no matter what.

  • I already mentioned above, remove the angle actions you've added if the bullet is going at the same direction

  • But I did, initially my events didn't have any angle action except the loopindex, which is necessary. The bullets wouldn't keep their original angle, that's why I tried to fix it with the stored angle. Doesn't work either.

  • They should continue moving unaffected if you didn't change anything. Another possible issue is if that event is running constantly from the top.

  • I finally fixed it! I don't know why but it was the deceleration. I changed it to -99 and now it works.

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