R0J0hound's Recent Forum Activity

  • I won’t be able to show an image of events. But it would basically be what I wrote.

    Here’s another way that just skips the json object. Basically store the json in a text variable, loop over the characters, have one condition to have it only look at letters, and a second condition to see the letter was listed yet. And finally adding the letter to a unique list.

    Global text letters=“ABCDEFGHIJKLMNOPQRSTUVWXYZ”
    Global text json=…
    Global text unique=“”
    
    Start of layout
    Repeat len(json) times
    Compare: find(letters, mid(json,loopindex,1)>-1
    Compare: find(unique, mid(json,loopindex,1)=-1
    — add mid(json,loopindex,1) to unique
  • Easiest is to have an empty dictionary and then loop over each letter or each word and add that letter as a key to the dictionary. You’ll end up with one key for each unique letter. You can then loop over the keys to get the letters.

  • The least technical way to do it is just make the level up of a bunch of individual objects that you reuse all over. Tilemaps let you do that in a grid.

    Just drawing a big image for the level may work for the level visuals but you’d still need to indicate the collisions some other way. And depending on how big the image is you may run into video memory or max texture size limitations on some lower end systems.

  • Here's for 0 to 99

    mid(" १२३४५६७८९",int(level/10)%10,1)&mid("०१२३४५६७८९",level%10,1)

    or this

    (level>9?mid("०१२३४५६७८९",int(level/10)%10,1):"")&mid("०१२३४५६७८९",level%10,1)

    And 0 to 999

    (level>99?mid("०१२३४५६७८९",int(level/100)%10,1):"")&(level>9?mid("०१२३४५६७८९",int(level/10)%10,1):"")&mid("०१२३४५६७८९",level%10,1)

    or 0 to 9999

    (level>999?mid("०१२३४५६७८९",int(level/1000)%10,1):"")&(level>99?mid("०१२३४५६७८९",int(level/100)%10,1):"")&(level>9?mid("०१२३४५६७८९",int(level/10)%10,1):"")&mid("०१२३४५६७८९",level%10,1)

  • You’ll probably have to restate the question. And no, just adding /2 isn’t what I was suggesting.

    What alexto suggested is elegant imo. It reduces all those events down to one event. And anything can be modified to meet other requirements you may have later. We generally reply with ideas that ideally you can then use or maybe modify to be useful for you.

    I don’t get the idea that formulas are your thing. I mean we all are at different levels. So here’s one last attempt.

    315 to 45 should be -22.5 to 22.5

    0 to 90 should be 22.5 to 67.5

    45 to 135 should be 67.5 to 112.5

    … and so on

    Notice the pattern? Where one range stops the next one starts so there is no overlap and no directions will seem to be skipped.

    I’ll leave it to you to find the other ranges but you can calculate them with:

    a-45/2 to a+45/2

    Alexto’s formula rounds an angle to the nearest 45 and combines it with an animation lookup. That’s super useful to simplify things.

    The meat of it is round(a/45)*45 which rounds to the nearest 45.

    And sure he wrote it for one animation type but it should be trivial to use the same idea for other animation types.

    Anyways, that’s should get you some ideas maybe. I don’t think I can give anything simpler that wouldn’t require a lot of extra work on my part.

  • If visuals help you could draw a circle cut into 8 slices like a pizza and measure angles of the edges.

    Otherwise I’ll just defer to suggestions of others.

    Again it looks like the angle ranges you’re using are overlapping each other which makes it seem like things are being skipped. You need to reduce the angle ranges so they don’t overlap.

  • Consider the first two ranges 315 to 45 and 0 to 90. They are overlapping by 45 degrees. And all of your ranges overlap similarly.

    Those should be 0-45/2 to 0+45/2 and 45-45/2 to 45+45/2 and so on. Notice the pattern? You could also use the condition angle is within 45/2 degrees of 0.

  • The angle ranges you’re checking are overlapping. That would explain the skipping. Probably making the angle ranges not overlap would fix it.

  • Hi, no worries. Glad some of what I wrote was helpful. I haven’t been able to look into this further. There’s no urgency to reply to forum posts.

    Forces with the physics behavior are off by 50 times. So unfortunately a calculated force will be off unless it’s adjusted.

    What I mean by those velocities is say you want to calculate the force to stop an object in motion in one second. The start velocity can be anything and you’d want the end velocity to be 0 in that equation.

    So the formula would simplify down to:

    Forcex = -mass*velocityX

    Forcey = -mass*velocityY

    Now to make the units correct you have calculate the mass yourself since the expression is off.

    It comes out to something like this as I recall with the physics behavior.

    Mass = area*density = (width/50)*(height/50)/1

  • That’s an easy fix. Move the is in viewport check above the pick random instance condition. That way it won’t pick an instance you already used.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you aren’t concerned with where the ray is hit you could set the ray angle, then set the size to 1000,1, then do events like

    Ray: overlaps wall

    Wall: pick closest to Ray.x, Ray.y

    Beyond that I don’t know what to tell you. Try searching for an addon that does raycasting for you.

  • I mean either you’d need to move overlapping objects apart or you’d repeatedly try a new random location if an object overlaps anything else.

    Another idea would be to manually design some spacing of objects to use, and utilize some alternate arrangements for variety.