mekonbekon's Forum Posts

  • 25games It's essentially the same problem in both examples:

    In the first example the issue is with event 3; you don't actually have any enemies picked, so if *any* enemy's distance is less than the min distance then *all* the enemies will stop. You can either use a "for each enemy" condition or swap the condition around to check if enemy.minDistance > distance(Enemies.X,Enemies.Y,Player.X,PlayerY) to ensure each is checked individually.

    In the second example the problem is with the Else conditions in event 7 and 8: event 6 will check all Characters for "attacking"; If *any* Character is not attacking then *all* Characters whose velocity > 10 will be set to run, but the "Else" in 8 means that if *any* Character's velocity is less than 10 then *all* Characters will be set to idle.

    The trick here is to use inverse conditions: swap the Else in event 7 for "Character is NOT attacking". Make the velocity check and event 8 sub-events of event 7 and swap that second else for character velocity <= 10.

    As a general rule, avoid using Else for checking against objects, especially where multiple instances are concerned.

  • dop2000 great stuff! Really like the alternate frame technique and removing the detector. I swapped out the "8" for "ship.imagePointCount". I didn't get much of a chance to look at this last week; if this one is less hectic I'll have a pop at converting it to a function so it can handle multiple object types.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check out this thread for some demos:

  • A trick I used with reasonable success (originally suggested by someone else on the forums) was to have to have an invisible object per enemy do the pathfinding, give the enemy object physics behaviour and move it towards its partner invisible object.

    You pause the invisible object from moving if the distance between it and its partner enemy becomes too great, allowing it to catch up.

    The physics behaviour allows the enemies to bounce off each other without overlap.

  • Daplayazclub

    Here's an example I made a while back that has full body movement:

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

    And here's a latest playable version:

    http://bats.bitballoon.com/

  • dop2000 Neat! Good catch on the issue with complete overlap - I think my example should work okay if the objects are solid though. I've also had a few thought on how to reduce the number of particles objects generated and to generate particles from both sides (using two detectors, one stepping clockwise, the other anticlockwise) - hopefully I'll get a chance to give it another go at some point this week.

  • Sure you can make it inactive:

    1) Set the particle to "Continuous spray" in the object type properties.

    2) In the particle actions, under "Particle Spray" use the "Set spraying" action and set to "Not Spraying".

    If you are using it as an engine flare then you will also want to add the pin behaviour to the particle object, move it to engine at the start of the layout and pin it to the engine.

  • Okay, managed to get continuous particles working:

    https://www.dropbox.com/s/7xf5snsy01017 ... .capx?dl=0

    You can drag the asteroid around the ship and the particles will follow the collision point.

  • IGDev

    Here's an example:

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

    Left or right click on the bars to change the values.

  • IGDev

    X is the maximum value of SP and SM e.g.

    If SP and SM can each have a maximum value of 150 each then the equation would be:

    int(100*(SP+SM)/300)

    ideally you would hold those max values in variables, so the equation would be:

    int(100*(SP+SM)/(SPmax+SMmax))

  • On start:

    set percent to int(100*(SP+SM)/(2*X))

    set text to percent&"%"

    On any trigger event where SP or SM change:

    set percent to int(100*(SP+SM)/(2*X))

    set text to percent&"%"

    This assumes that X is the maximum value that SP and SM can have.

  • Cheers tarek2

  • dop2000 Very cool! I'll have a fiddle around with this and see if I can adapt it for continuous particles, so you can get some neat scraping effects when sprite slide across each other.

  • brunopalermo

    Cheers I'm not sure how well it would work for two complex shapes (say two stars) colliding, where the actual collision point could be a way off from the origin-to-origin intersection. Still, it's useful for simple scenarios.

  • I used this solution for a laser beam:

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

    I'm guessing you can reuse this technique of stepping back in a loop for any object.