oosyrag's Forum Posts

  • Fake path is what I was thinking. Just a quick idea, I haven't tried this, but if your layouts are generally going to be similar to your example it should work...

    You're going to spawn four invisible helper objects at each wall object , offset at each corner. Whenever you select a destination, your player will pick the nearest helper object that exists between player and destination, and move there. When it arrives, repeat for the next closest helper object between player and destination (the ones that have been passed are no longer considered). Continue until no more helper sprites exist between player and destination. This should get you a very rudimentary pathfinding system.

    There are many situations it might not be ideal though...

  • What is the reason not to use pathfinding behavior?

    Another option would be to create a custom pathfinding system, which could possibly be simpler than boids or SAT depending on how flexible you want it to be.

  • Full answer: https://www.red3d.com/cwr/boids/

    Simple answer: Have each obstacle exert a force vector proportional to the distance away from the object, away from the object.

    Edit: If you have long straight objects like walls, pathfinding is generally the better solution...

    I've also seen SAT used to have objects slide off and around each other http://www.dyn4j.org/2010/01/sat/

  • Which part are you having trouble on?

    Here is a commented example: https://www.dropbox.com/s/69dqyvjskr9nr ... .capx?dl=0

  • Haven't confirmed but (viewportleft+viewportright)/2 sounds like it should give you the middle of the viewport regardless of where on the layout you are. Even when you are parallaxes, as long as you place the object on the same layer as you are getting the viewport numbers from it should work fine.

    You can try viewportleft+(originalwindowwidth/2) as well.

  • On touch sprite - Set var to var=7?1:var+1

  • Put the origin point at a tip of the triangle.

    For each hexagon x/y

    Repeat 6 times - Spawn triangle at x/y, rotate loopindex*60 degrees.

    To get a random color for each triangle, assuming you are using a single object with different animation frames, add an action to set animation frame to floor(random(6)).

    To get a non-repeating random color for each triangle, create an array size 0,1,1.

    Step 1 - Populate the array

    Repeat 6 times - Array Push Back loopindex

    Step 2 - Pick a number out of the array out of the remaining available numbers (use a variable)

    Set PickedIndexVariable to floor(random(array.width))

    Step 3 - Apply the picked number

    Set triangle animation frame to Array.At(PickedIndexVariable)

    Step 4 - Delete the picked index so it can't be picked again

    Array delete index at PickedIndexVariable

    Repeat steps 2-4 until all numbers are picked

    Repeat step 1 for next set of triangles.

    Repopulate array

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are many ways to create a "seeded" random. There are different advantages, disadvantages, and varying levels of complexity for different methods. Depending on your particular needs, you should pick the most suitable method. The general technique is called pseudo random number generation.

    https://gist.github.com/blixt/f17b47c62508be59987b

    https://www.geeksforgeeks.org/pseudo-ra ... ator-prng/

    https://en.wikipedia.org/wiki/Pseudoran ... _generator

    https://en.wikipedia.org/wiki/Middle-square_method

  • Try using the timer behavior, with the "On Timer" condition turning the light on.

    You can either set all the objects to different times from the start, or you can have one timer trigger the next one to start in sequence.

  • Yup, that would be the simpler one, but watch out if it goes past 9, that wouldn't work.

  • Here is a Zelda style screen transition example - https://www.dropbox.com/s/021q4g1xnl30r ... .capx?dl=0

  • Oops messed up my parentheses, try:

    On Next - > Set Sprite Animation to str("a"&int(right(Sprite.AnimationName,len(Sprite.AnimationName)-1)+1))

    On Previous - > Set Sprite Animation to str("a"&int(right(Sprite.AnimationName,len(Sprite.AnimationName)-1)-1))

    Don't have the program handy to check right now. Let me know if it works.

  • On Next - > Set Sprite Animation to str("a"&int(right(Sprite.AnimationName,len(Sprite.AnimationName-1)+1))

    On Previous - > Set Sprite Animation to str("a"&int(right(Sprite.AnimationName,len(Sprite.AnimationName-1)-1))

  • 1 - Create app with 7 languages

    2 - Allow user to select language - save the selected language to a global variable

    3 - Display menu based on whatever language the global variable specifies

    4 - Save global variable to localstorage "languageSelection" key

    5 - On start of layout, if "languageSelection" key exists in localstorage, set global variable to "languageSelection"

  • This is a chrome issue I think, where it tries to be more efficient by not running things that are tabbed out.

    Last I heard this does not apply to tabs with audio playing, so that was the workaround. You can use a short silent loop.