How do I partly destroy object like space invaders

0 favourites
  • 8 posts
From the Asset Store
Spaces Ambience contains 102 Sounds: 53 track and 49 sounds
  • Hi,

    I want to make app with space invaders mechanics, where bullets are destroying object piece by piece. I want to have few custom object being destroyed like this, all of them are solid color just like obstacles in space invaders. But I don't know how can I achieve that without bottlenecking my PC. I tried to use dots to create my object but suddenly I had 100k + collision checks.

    Thanks for any advice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How do you check the collision? You can try to improve the collision checks, i had same problem with my game which had around 150k collision checks but after messing around with the events i improved it down to 1k only.

  • There's a big difference between "bullet on collision with brick", and "brick on collision with bullet".

  • There's a big difference between "bullet on collision with brick", and "brick on collision with bullet".

    Can you describe how you mean it? Because I don't see a difference at all.

    How do you check the collision? You can try to improve the collision checks, i had same problem with my game which had around 150k collision checks but after messing around with the events i improved it down to 1k only.

    I had simple bullet-on collision with dot-destroy dot and bullet

    I tried to divide it into sectors, so first I check if bullet is in sector "A" and if yes, check for collision with dots in sector "A" it helped to reduce checks/tick from 12000 to 2000 but I still feel it is too much because performance on mobile is not smooth. Also I'm testing in on low end mobile, with snapdragon 212... still I feel like there should be a smoother way.

  • Another way of doing this. Example is not perfect, but shows the basics.

    https://www.dropbox.com/s/8zu69ylvpf0lu ... .capx?dl=0

  • > There's a big difference between "bullet on collision with brick", and "brick on collision with bullet".

    >

    Can you describe how you mean it? Because I don't see a difference at all.

    Filtering means using the object you have the least amount of to check for collisions.

    The system only checks for the first object referenced in the condition.

    You might have only one bullet, and hundreds of bricks.

  • Another way of doing this. Example is not perfect, but shows the basics.

    https://www.dropbox.com/s/8zu69ylvpf0lu ... .capx?dl=0

    Thanks! I never realized I can use tilemap like that. This pretty much solved my problem!

    Filtering means using the object you have the least amount of to check for collisions.

    The system only checks for the first object referenced in the condition.

    You might have only one bullet, and hundreds of bricks.

    Still don't understand. I have 1 bullet and lets say 5000 bricks. What is the difference in checking if 1 bullet is touching any of those 5000 objects (5000 check) or if every single object from those 5000 is touching one bullet (also 5000 checks)

    I even tested that and there is no difference in checks/minute or fps.

  • You may not see a difference for that example, but it works in conjunction with other filtering such as "is on screen", etc.

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