Destroy a bullet (the layout is 20,000 width)

  • Hi, this is a bit of a rookie question. However proving tricky. How do I destroy a bullet outside the screen? Destroy bullet outside layout won't work because my layout is 20,000 width. The bullet just keeps going. Which is a no no.

    Anyone be able to give a event please?

    My bullet destroys if it hits tilemaps ect, but if it's a sky shot it just goes on and sometimes kills enemy's who are a few screens onward.

    Please help, thanks

  • Sprites have a condition 'is on-screen' if you negate this you can destroy the sprite if is not on the visible screen. Your sprite has to be on screen from start or spawn on screen otherwise it would be destroyed immediately.

    Bullet| (not) Is on-screen -> Bullet| Destroy

  • Depending on the game, it might seem strange if the player finds that some bullets fly farther than others or some shots are eternal if you run after them.

    Another option would be to give the bullets an instance variable in which the maximum range is set. Then you can compare the flight distance with the variable and destroy the bullet / fade it out when the maximum range is exceeded (provided you use the bullet behavior).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Than you very much buddy, So just set x bullet destroy? somthing lieke that?

  • Sprites have a condition 'is on-screen' if you negate this you can destroy the sprite if is not on the visible screen. Your sprite has to be on screen from start or spawn on screen otherwise it would be destroyed immediately.

    Bullet| (not) Is on-screen -> Bullet| Destroy

    Ahhh yeah, this is perfect. I never realises that this was an option. Thanks very much buddy :-)

  • Thanks buddy, cheers for the event. That may come in usefull as well. I think I will use both ddepending on the situation. Appreciate you taking your time to help.

    Thanks to everyone who helped!

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