oosyrag's Forum Posts

  • The solution for nearest wall is simply to design the level taking it into account. Basically no long stretches of walls. Alternatively, use a different type of wall for long sets of walls - just put the "cover" type wall at the ends or corners.

  • Nah my idea in that thread would have the exact same problem actually. It assumes empty space behind the target, otherwise the wall behind the target would be the first thing hit.

    A better system would probably have a bunch of potential "cover locations" at all times set by the player position, and the enemies would pick the one with lowest pathfinding cost, since the nearest point by distance may not always be the shortest path.

    Unfortunately I'm not seeing a way to get the path length with the built in pathfinder expressions, besides which it could get quite costly to find a path to every potential cover location just to check the distance.

    Getting the path length is possible by looping through all the generated nodes after finding a path, but it would still need to be calculated and compared with all potential pathfinding targets, which sounds awfully heavy to me.

  • Not really, not for a sprite with a donut shape like that.

    The most straightforward way would be to create a set of sprites of all the different sizes you want. Probably different animation frames of one sprite object, and you would choose the animation frame of the suitable size for any given planet.

    You might be able to use an html/form element with styled css, which can set fixed border sizes, but that's going to cause all sorts of other problems you won't want to deal with down the road.

    Edit: You could also probably draw them dynamically with the drawing canvas plugin

  • "Nearest wall" would be easy, but it's a weak algorithm would only work with very specific level designs.

    It can only work for uniform wall tiles, maybe from a tilemap, and even then it would be illogical for more complex walls. For example, in the following image if blue were the player and red were the enemy, green was the nearest wall, then the pathfinding target would be at yellow, which is silly.

    If you want to do it like this anyway:

    On "flee" state

    Pick nearest wall to enemy - Create helper "target" sprite at wall

    While target sprite is overlapping wall - Move target sprite one pixel/tile/step at angle(player.x,player.y,target.x,target.y)

    Pathfind to target, destroy target

    If enemy does not have line of sight to player, stop pathfinding, change state

  • Weird! Graphics driver? Hardware acceleration enabled?

  • Your preview browser is Firefox and nwjs is chromium, which probably has something to do with it.

  • Sorry I wasn't really familiar with the details myself, I just found that and it seemed like a good place to start looking.

  • Is your project large enough to need a loader screen? You might just be downloading fast enough to skip it, or your game is already cached.

  • Oh I see. In that case you probably want to make your own custom particle effect, you'll have much more control.

    Create a particle sprite object with fade and bullet behaviors. Spawn at interval as desired and set the bullet angle of motion as I described earlier.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, guess I did not understand.

  • If you want help, the least you could do is post your project with the script to show what you've done so far. Also you might get more help with using a javascript library in the javascript subforum. You most likely didn't set your imported script as the main script.

    dropbox.com/scl/fi/apo8opxtpekj3qvsbhyli/tone.jsexample.c3p

  • Set a timer that triggers after leaving a platform. While the timer is running, allow jumping.