R0J0hound's Forum Posts

  • A rough starting point could be something like this:

    Player overlaps wall

    X player overlaps wall at offset (0,-1)

    — set onGround to true

    Other ideas could be to sample points below the player for overlaps, or position other sprites around the player for overlap checks, or checking the length of a ray cast below the player, or maybe checking the physics contacts and see if any of them are roughly pointing up. The platform behavior detects of the player is on the ground at the same time as it pushes the object out of walls vertically, but with physics you’ll have to resort to one of the other ideas.

    There are probably other approaches too.

  • You can approach it a few different ways.

    One it is to use html elements with css and javascript to make something like that. At least in theory I think you could. Be prepared to fly a bit blind to do it since it's beyond the scope of what Construct helps you do.

    Another idea is to just build it out of sprites, text, buttons, etc... You could put it on a layer so everything can be hidden in one shot. This is the approach best suited for doing it in Construct. For more complex dialogs you'll have to deal with it case by case.

  • paste the object and then paste all the sprites with a higher z order with destination out.

  • When the speed is 0 then yes the default moment angle is to the right. This happens because internally the behavior stores the x and y velocity separately and calculates the angle of motion from that. Angle(0,0,vx,vy)=0 when vx=0 and vy=0.

    Anyways an often used solution is to set the angle of motion directly after setting the speed.

    As to your other issue, setting the speed would be different than simulating a key press. When simulating a key the acceleration, deceleration and existing velocity are in the mix. So it would make sense that it would almost always be slower than setting the speed directly.

  • There are algorithms that let you find out how close one text is to another. Basically the number of character additions, deletions and replacements before the texts are identical.

    Here is one such algorithm:

    en.m.wikipedia.org/wiki/Levenshtein_distance

    I guess you could run that with the typed text and all the possible words, then use the closest one. Effectively it’s kind of your own spell checker with your own set of words. More likely you’d want to not consider words that are more than 5 edits away or something, and if there are multiple words with the same minimum distance away you could maybe show a suggestion to the user.

    You can tweak it further too. Most spell checkers consider adjacent keys as closer. Or transposed characters as being close too. I didn’t look further at different algorithms though. Anyways some ideas you could pursue.

  • Not sure how much control we have over constructs audio system. But worst case you could attempt to use html5 audio directly to allow attempting more ideas.

    Instead of using the file name directly this topic seems to indicate that using a dataurl or load the file as a blob first reduces the delay but I haven’t tested it.

    stackoverflow.com/questions/27242821/delay-in-playing-html5-audio-file-on-mobile-browsers

  • This could work.

    tokencount(text, "we")-1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I haven’t used them but that was mainly because the debugger didn’t let you step through loops and sub events or per condition and per action. Maybe that has since changed, but at this point I’ve resorted to other debugging methods.

  • Every tick

    — Red: set angle to int(pink.angle/22.5)*-45

  • Is it in a loop? You’re using loopindex.

    Is the text you’re using token at with getting longer over time?

    I’m at a loss otherwise. I have only a passive interest in construct lately

  • If the engine usage increases over time you’re doing something that does more over time. It would be a shot in the dark to guess what.

  • You’ll want to use a spritefont instead of the text object. That of maybe utilize the alpha clamp effect on the text object to see how that looks.

    Browsers don’t provide a way to disable anti-aliasing for text rendering from what I’ve found. So spritefonts are the way to go

  • A slightly different approach would be to list the neighboring countries for each country and do some kind of path finding with that. Then you’d color the country you clicked on based on the number of countries away you are.

    Again I don’t have a simple solution for that either. You’d need some kind of node based pathfinding.

  • There isn’t a super simple solution to that. There is an algorithm called gjk that gives the distance between objects. There’s also mpr that could possibly do that too but there’s less info online about that.

    Worst case you could loop over all the points and edges of both objects and measure the distance between them. The lowest would be the distance. Just point distances could be good enough.

  • How far did you get trying to convert it yourself? Anything you get stuck on? I’m not interested in doing that kind of thing but can help here and there. For example the ~~ is the same as int().