I want to make two sprites to gradually appear after that a group of sprites are destroyed.

0 favourites
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • You can guess that this is in fact very normal, as your lasers are gradually destroyed to avoid memory issue, and 8 instances is nothing for the memory;

    I was talking about a non-stop increasing number, there must be an object instance increasing abnormally, I see on the top left that there are 51 109 objects on your layout, that is enormous, no wonder your game is slowing down, continue to look for it

  • To Tomycase:

    I need guidance. What is the label of the value who is increasing without any limit? To be more clear what is the word located next to the value who is always increasing. I am asking you that so it's going to be more easy for me to find the problem.

    And there is something else, there is a third sprite. It's a robot who moves back and forth because of a "Sine" behaviour. Maybe he is the one who takes a lot of memory.

  • On the left of the debug menu, you have the list of all the objects in your project, and next to the names, the number of instance of each object; On the top bar of the debug menu, you can see how many objects are currently created on the layout;

    On your screenshot, there is over 51000 objects at once, that can only mean that an event is creating continuously instances of an or multiple objects, this number isn't normal at all;

    What you need to do, is to look which objects in the debug list has a very big instance number, and once located, find the corresponding event in your code;

  • To Tomycase:

    Ok, this time I think I finally find the issue. It's a sprite named "sprSuperComputerLaser" who is causing this. The image below indicates that 177147 instances of this sprite were created and in your previous post you told me to look for an object in the debug list with a very big instance number, so it must be him:

    Here's the event in my Event Sheet who is related to the instance:

  • Yup it's definitly this, and looking at your event, I can understand why it increases so fast, since your asking the program to spawn a sprite from the same sprite, which mean each laser will spawn an instance of itself, each time multiplied by the new number of instance which keep increase;

    What do you want to achieve with this event? So I can look for a fix

  • To Tomycase:

    It was an error base on a lack of attention. I tried to make the laser come out of the eyes of the sprite named "sprSuperComputerFace". And those laser rays are supposed to target the player.

  • Perfect, your game should run fine now

  • To Tomycase:

    Thank you very much for your patience! The bug is gone and now I can continue the development of my game!

    Thank you a lot for your assistance!

  • No problem! Can't wait to see your game ^^

  • To Tomycase:

    I am sorry, I am becoming annoying but the code that you suggested to me for the sprites named "sprSuperComputerFace" and "sprComputerEnergyField" no longer works (The sprite refuses to appear). This is a picture of the code that you told me to include in my Event Sheet, so you can remember what I am talking about.

    This is the example that you give me:

    This is what I have placed in my Event Sheet:

  • Did you make sure that Activation was the same as enemies number? Otherwise maybe another event was interferring because it should works, as 4*25 = 100, also you should move the collision actions to the top event instead of sub event as it needs to be trigger only once

  • To Tomycase:

    Thank you for your guidance I have solved my problem. I thought that the "Activation" variable also involve the copies of the sprites but it was only the originals. Thank you! I hope it will be the last time I will disturb you! Thank you again and take care!

  • Well it should involve all instances from the enemies family, but if it works now well that's good, glad I could help ~

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To Tomycase:

    One last question, I have noticed that the sprites named "sprSuperComputerFace", will only appear if the sprites who are involved in the Family are destroyed in a certain order. The two Turrets have to be destroyed first so the "the sprites named "sprSuperComputerFace" can appear. If the family of sprites are destroyed in another order the sprites "sprSuperComputerFace" will not appear and the opacity will remain at zero. Why something like that occurs?

  • It shouldn't, the event that look for the objects destruction doesn't take any order in account, only the fact that an item in this family is destroyed, it is probably caused by something related to your code or your enemies sprites before starting a preview

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