Can i get your expert knowledge to help me guys. :)

0 favourites
  • 9 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am making an Asteroid/Malström clone. And here is my problem - when i shoot a bigger asteroid it should split into two smaller asteroids as usual. But sometimes the asteroid splits into four smaller asteroids.

    I know what the problem is but i can't find a solution to the problem.

    The tings is that i shoot with a double shot (as shown in the image) and both bullets has an unique UID. Sometimes they hit the asteroid at the same time and repeats the function two times, that results ine double op in asteroid spawning.

    Any kind heart out there that could help me with my problem?

  • I'm only a beginner myself so I hope you find this helpful.

    #1. What about creating your shot object(sprite) containing both shots.

    #2. Your big asteroid on collision with bullet instantly spawns the 2-asteroids, so maybe add a timer to asteroids before they spawn another.

  • After the hit check if a bullet overlap at offset an asteroid and destroy it.

  • You can give your asteroids an instance variable or boolean and change it when it is hit by a bullet. Add a second condition to your event like: Asteroid on collision with Bullet AND Asteroid Variable/Boolean = 0.

  • aeroslim - unfortunate not, you see the spaceship can have mono, double and tripple shot and the last two can have various angles, depending upon powerups.

    But thanks anyway! :)

  • savvito123 - ah, i will give that a try, i have not thought about that koncept. Thanks! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • kriand - i've tried something like that, but to no aid. I think it has do do about that the collision happens on same tick and it just fires up the same function.

    Is there anyway a UID could be set to create Max two objects maybe?

  • I made a few examples yesterday but it didn't let me post it, had some Captchas problem not displaying but for some reason is working again today, I see that Kriand recommended the same thing but I will leave it just in case.

    This one the newly created asteroids can be destroyed right away by the second bullet

    https://www.dropbox.com/s/hotysc5m5be39dv/2-Bullet%20Multiple%20Hits%20only%20one%20To%20Count.capx?dl=0

    And this one the newly created asteroids cannot be destroyed right away by the second bullet, they have a Cooldown Timer 1 sec

    https://www.dropbox.com/s/6d8gax9crhdkrn4/1-Bullet%20Multiple%20Hits%20only%20one%20To%20Count.capx?dl=0

    Or

    if you need to destroy the Big asteroids just once and block the newly spawned asteroids so they don't get destroyed again just set the boolean to true the sooner you create the two objects on Event 6 and remove the timers and all that stuff you don't need it

  • tarek2 - this is very much appreciated my dear construct comrade! I will try an implement it over the weekend an return a status quo.

    I did try the wait a bit before spawning other objects but to no succes. But thanks for taking your time to help. I am pretty sure you fixed my problem. Cheers :)

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