eli0s's Recent Forum Activity

  • Ok, so,

    1) You want each enemy instance (Sprite2) to spawn this Sprite1 every time the player's circle collides with the enemy.

    2) You want each Sprite1 (which was created before) to be destroyed if the player's circle is not overlapping the "parent" enemy any more.

    3) You want everything above to be independent from each other, every instance to it's own in relation to the player.

    Considering all the above, this is the best I can think of right now.

    http://www.eli0s.com/Tests/SpawnedIDs.capx

    I am using a distance check instead of the collision polygon of the circle (I've left the circle visible for illustration purposes) and instead of spawning the Sprite1, I set it's opacity to 100 when the player is within the desired distance and to 0 when it's not.

    You can trigger different animations or frame numbers by adding sub-events (if you change the animation, don't forget to add the "Trigger Once While True" under "System" conditions).

    I have to admit, this is more difficult that I'd imagined, correct picking is a #$% and I really don't understand why I had to use the "For Each" loop, since Construct 2 supposedly picks every instance internally by its self.

  • It is normal if you have many objects and you leave the debugger showing and updating everything (the default state when it runs). Just click on the things you wish to check (the eye icons are very handy if you want to inspect many different items at the same time) and you will see great improvement in fps, if not the same as when normal previewing.

  • Hmmm, I can't see any delay in my system. Almost any browser opens and runs the preview at the same time. I used the rts template to have a standard benchmark project.

    Perhaps it's what Knifegrinder said. Have you used the debugger? Check if the CPU runs at within the expected levels, maybe something stresses it for some reason.

    -EDIT-

    Great!

  • Is this delay present with other browsers too? Have you tried Firefox and/or IE for comparison? The delay happens every time you hit "Run Layout" and if yes, even when the previous Preview is running in Chrome? What version of Construct are you using?

  • Yes, it's the latest beta (167.2). Sorry, I forgot to mention it.

    I don't know if you can have more than one versions installed at once, I have never tried it. My guess is that if you use a different directory you won't have any problems. Maybe untick the "create desktop shortcut" option if you already use one, just to be sure that nothing gets overwritten.

    Although, so far the beta looks stable.

  • Thank you! Very useful!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, in essence you would like to spawn an other sprite and change the animation on the current sprite (the enemy) ?

    Download the example capx again, I have updated it to reflect the above requirements.

    And yes, it's the latest beta, sorry, I should have had clarified it

  • You will either use a different sound file that was made to meet your needs, or the low pass filter effect in the advanced audio category.

    See this capx and tell me if this is the effect you what to achieve.

    http://www.eli0s.com/Tests/SwimmingWithTheFishes.capx

  • Each time the player triggers a collision (the circle around the player) with an enemy, only that enemy's instance should be affected. I don't understand why all of the enemy instances are being triggered.

    Look at this capx and tell me if this is what you want to achieve: http://www.eli0s.com/Tests/ScaredEnemies.capx

    I am using a Boolean Variable on the enemies to check if they have being collided or not and when the Boolean is true, they change their animation and position.

  • eli0s thanks a lot that fixed it. I don't know if you can answer this but is there a way to check if the picking up 5 hearts event has already run once, so on the next 5 hearts that get picked up I can add 1 more to the health and set a new animation? At first I had it set up to hearts = 5 then +1 health and set frame animation, then hearts = 10 then +1 health and set frame animation, but since I am now resetting the hearts variable after 5 are picked up I don't know how to check if the event has already happened so the next time I pick up 5 hearts I can add health and change animation frame.

    You only have to link the Health variable to the animation frame. Whenever the value goes up, the frame number will correspond also.

    Re-download the example capx, I have updated it to reflect the linked frames.

eli0s's avatar

eli0s

Member since 24 Apr, 2013

None one is following eli0s yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers

Progress

13/44
How to earn trophies