How can I destroy the objects as they come out of the screen

0 favourites
  • 6 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi, my friends, I would like to see if you can help me with something. I'm creating a platform game in which the player always goes forward and can not go back. That is why I want it to be destroyed when an object is out of the view of the screen. So it does not consume memory in the collision check. Can someone tell me how?

  • Simply give it the behaviour destroy outside layout.

    If your window is smaller than your layout and that doesn't work for you, do the following:

    • add a family with all the objects you want to be affected by this
    • add two conditions:
      • if [family] x is between 0 and Window.width (invert condition)
      • if [family] y is between 0 and Window.height (invert condition)
    • under those conditions, add: [family]: destroy
  • Ook, I'll try that thanks !!!

  • I'll even have to try that randomly

    Right now, i have invisible sprite rectangles that stretch the length of the window, offset just a few pixels, on all four sides. I have an event/action: Sprite > On collision with (those boxes) Sprite > Destroy.

  • jeffige

    Cojoyo

    I just realized that there is a possibility which is way easier:

    conditions:

    • [family] Is on screen (invert condition)
    • Trigger once while true
    • event:
      • [family] Destroy
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Jjj, I'm already using that second option, it works very well. Thank you.

    I want to test this because I notice that collision checking objects are always consuming memory, so I want to see the effect this can generate for reducing memory usage. It's that in the game I'm creating

    When testing on the tablet runs at 30 frames which is very slow and I have tried everything and this does not improve, but I know that the highest consumption is always between objects and graphics mainly.

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