Zevka's Forum Posts

  • 4 posts
  • Are you using call function after delay?

    Nop, simple call function.

    newt's question plus:

    "may be it's due to the time when they were spawned"

    Are you spawning them in the same tick, when trying to access a pv of the enemies? Sprites are created at the very end of a frame. Maybe that is causing problems in some situations, because the function call takes place the moment you call it.

    Enemies are spawned randomly every x milliseconds, it's not tick based i think.

    Bullet are spawned every 100 ms if mouse button is down.

  • The two events picking bullets are :

    • On collision between Bullet and Enemy
    • On collision between Bullet and Solid

    Is that the problems ?

    I'll upload the cap at the occasion, but it's quite a mess as it's my first project and I already got a lot of event and pieces of scripts.

  • Nop, neither the bullet nor the ennemies are global.

    Got quite a similar problem today, I created a function with one parameter.

    The parameter is an amount of damage, choose randomly at the call of the function, the function substract those damage from the ennemy and add it to the score.

    When I used "forget picked object", all enemy where damaged together. So killing an enemy will make all of them blow up.

    When I use "remembered picked object", sometimes only one dies, sometimes all of them, sometimes it seems they take only a part of the damage (may be it's due to the time when they were spawned).

    I think I don't understand at all how it's suppose to work.

    Is there a way to access a specific object in python ? I know that the "Enemy" variable works as a list, but how can I retrieve the exact enemy (well, the index) concerned by the event ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I set up a function (DestroyBullet) to destroy instances of bullets (shot by the player). The function simply destroy the bullet object and spawn an explosion effect (an animated sprite, fading).

    I used a similar function (exactly the same events used) when I destroy dead ennemies. For those, I used the option "Remember picked objects", so the function only destroy the one effectly dead, and it worked perfectly.

    When I use the function on my bullets (they are destroyed when hitting a solid object or an enemy), with the exact same options, it doesn't, every time, ALL instances of bullet are destroyed, no matter what I use (remember or forget picked object).

    If I copy/paste the two events of the function in the conditions that would normally trigger DestroyBullet (instead of actually calling the function), it work perfectly.

    Have I did something wrong ?

  • 4 posts