WackyToaster's Forum Posts

  • A more elaborate algorithm such as SAT (separating axis theorem) would give a more precise normal between polygons

    Yeah I read about SAT here and there but implementing it is a different story. The reason why I did it with a raycast was that it's a simple solution that I'm familiar with, even if not perfect. But I might have to go for "perfection" here because of the jank.

    After the ray cast and comparing the normal you push out of the solids with a loop. First you say you try to push out left then right. The push out right is not doing what you think it’s doing. You’re just moving at the opposite angle which is back into the solids.

    Uhm I do believe I have the logic correct here though. I first attempt to push out to the left, if that succeeds I keep the position and don't push out to the right anymore. And if pushing out to the left fails, I reset the position, then attempt to push out to the right. If that succeeds I keep the new position, otherwise I reset again (no pushout). Maybe not the cleanest code though but it's WIP :) I suppose a better version would be to do both attempts and see which direction needs the least pushout to work, then pick that one.

    I also see you’re using the reflection angle when doing the pushing. You possibly could try using the normal instead.

    I did try the normal angle which zooms the player along the slopes. I think I ended up using the reflection angle because it conveniently simulates a kind of friction and slows the player down more if the slop is less steep. Otherwise the player would zoom along the slope at crazy speeds.

    Nvm I was silly and my brain kind of didn't compute that the reflection angle is not what I was actually looking for. I was indeed looking for the normal angle.

    My basis for this was this tutorial for corner correction and I just kinda tacked on from there.

    youtube.com/watch

  • I'm currently in the process of "modding" the platformer behavior (without hacks) to handle slopes on the ceiling in a neat way. I do believe I'm really close, but there's some jank left. So I'm posting my code here in hopes some wizard can do magic and of course in return everyone is free to use this code.

    wackytoaster.at/parachute/ceilingSlopes.c3p

    There's some jank when jumping into a place where two ceilings sort of meet. Just try around in the project you'll surely encounter it. The player then jitters around and it doesn't look too nice.

    I probably ideally also add another function to handle the slopes when falling, because when you rub the wall when falling, the player seems to have their vectorX set to 0 by the behavior because it sees a "wall"

    In any case, I hope someone can help me make this as good as possible.

  • I'd argue the easiest way would be to use javascript since javascript doesn't care about what instance types you throw at it. I'd recommend doing it this way too because the "sort z order" action is specifically designed for this purpose.

    Sort the Z order of instances of a given object according to an instance variable. This effectively removes all instances from their Z order, sorts them, then inserts the sorted sequence back in to the holes left behind. This means if the instances are spread across a range of layers, they will be sorted in the same Z order locations, maintaining the same order relative to other instances on those layers. Note this action is much faster than using an ordered For each with an action like Send to front/back, so this action should be the preferred way to sort the Z order of large numbers of instances.

    And the code part is relatively easy to understand.

    const instances = [...runtime.objects.Sprite.getAllInstances(), ...runtime.objects.Fence.getAllInstances(), ...runtime.objects.[name of object or family].getAllInstances()];
    runtime.sortZOrder(instances, (a, b) => a.y - b.y);
    

    Now all you have to do is add all the objects you intend to sort by their Y position in the layout.

  • I've been encountering this issue sporadically for a while but never have been able to reliably reproduce it. I also have encountered the issue where image points I set to specific positions don't save the new position and revert to the old position as soon as I close the frame I edited (so even when I keep the image editor open and just go to the next frame)

    I'm always cruising on the beta branch.

  • You do not have permission to view this post

  • Here's a simple method to do this.

    wackytoaster.at/parachute/tokenAlongPath.c3p

    You could also use an array to define your path but since you're a new user I think this approach is just easier.

  • Trust me I've spend multiple hours to pick out the right song. :D It's not easy. I've also worked with some music artists before, also not easy (and more expensive)

  • igortyhon Played it a little bit. Works decent, couldn't find any bugs. I think it could use some polishing in general, but especially the sound loop of the tank driving. Because it doesn't loop properly and it's one of the main sounds you hear. Also, I think you could add some music. You'll probably make at least a few bucks on crazygames, so invest that in some music. ;) You can buy on audiojungle or whereever, it's not super expensive that way.

  • Thanks for explaining ^^ I suppose it makes sense in a way.

  • DiegoM Actually the 0-1 range is only for when using it in the plugin SDK. If you use the expression in events it's 0-100. According to construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    But I still don't understand the purpose of rgba() and rgbEx() with the values from 0-100. Not a single program I've ever used in my entire life did use 0-100 for setting RGB-colors. Except Construct. I guess it's easier to set something to 30% red, but that's such a specific thing I don't think I've ever needed that. Anyway, I'm glad there's still the variants that just take 0-255 values.

  • It was fixed for the mouse plugin, but it seems that the same fix is needed for the touch plugin. You can open an issue in the issue tracker, attach your test project for demonstration and perhaps also link to the old issue for reference.

  • It looks more specifically like this issue.

    github.com/Scirra/Construct-bugs/issues/8027

    It works as expected with the mouse plugin, but not with touch. I'd assume this is essentially the same bug.

  • Afaik Constructs layouts are set up to only ever have one layout active at a give time.

    What could possibly work is that whenever you detach a UI component, it launches a second instance of the project with the specific layout open. Then hook them up with a websocket somehow. But then again, Construct also suspends the engine when the window is out of focus, and it sounds like a bit of a nightmare to get working.

    Second thing I can think of is that you just emulate what Construct itself is doing. I don't know the exact workings of it though.

  • Compare two values

    Object.count <= 0 -> action

    Note that this will run every tick as long as theres 0 instances.

  • Check the manual, it's not much different than creating events.

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/functions

    You just create the function, add your actions (add 1 to variable, play sound) and then just call that function whenever you want to increase the players extra lifes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads