R0J0hound's Forum Posts

  • Maybe this topic helps?

  • I don't really have a simpler way per say. I actually don't use the customMovement's push out. Here is the push out/solid replacement I've come up with that works much better:

    how-do-i-make-the-8-direction-behavior-slide-against-wal_p904925?#p904925

    There are a few variations and although the logic is complex it should be usable by just copying it over.

    They don't touch the speed of the object but here's a way to just measure how fast the player is moving and use that for seeing when it's stopped:

    https://www.dropbox.com/s/fuly7efud7rvd ... .capx?dl=1

  • There's no diagonals in your capx. Anyways the idea's only fault is how far you overlap the wall depends on the speed, which may or may not be acceptable for your purposes. I'd guess in general for any wall in your game you'd put those wall sprites around them. For diagonal you may need to put two of them. Like for a diagonal going down and to the right you'd put a bottom and left sprite along the top right of the sprite.

  • Maybe more carefully placed walls? I haven't tried something like that.

  • Last I looked, the 8dir behavior collisions work like this:

    Move the object with it's speed

    if the object overlaps a solid then move it back to it's last non overlapping position and set the speed to 0

    It's a valid way to do it, but it can cause it to stop short of the solid, then speed up again to close the smaller and smaller gap. Aka the effect you are observing.

    So a more desirable behavior would be for the overlapping object to move flush against the solid before stopping.

    Maybe by not using the solid behavior, and using the push out action of the customMovement behavior when overlapping the wall sprite or just doing your own push out with events. I think there have been some other topics with examples of a push out with events.

    Another idea is to keep track if the object is moving or not over multiple frames and only change the animation if it has stayed the same over multiple frames. That should eliminate most of the flickering with the only drawback of causing a slight frame delay for animation changes. So for example if you keep track of 4 frames it could look like this:

    global number f1=0

    global number f2=0

    global number f3=0

    global number f4=0

    every tick

    --- set f4 to f3

    --- set f3 to f2

    --- set f2 to f1

    sprite is moving

    --- set f1 to 1

    else

    --- set f1 to 0

    compare f1+f2+f3+f4 = 4

    --- set animation to walking

    compare f1+f2+f3+f4 = 0

    --- set animation to stopped

  • There is no layout object in C2, but there is something called "global layers" that can be used for a hud.

  • link updated

  • Read about the web storage or local storage plugins. They can be used to save values from one run of the game to the next. You can look in the manual, the tutorials and maybe even an example template included with C2.

    Next you'll need to get the time when the game closes and again when you open it again. You'll either need a third party plugin or use some JavaScript with the browser object to do this. Subtract the two times and calculate the money earned with:

    Amount= rate * time

    Search is your friend for more info.

  • Links updated.

    And no, there is no way to do it without a custom plugin. I've made one that can handle the deformed drawing, but it's not simple. Also the interaction with the "jelly" is all custom. None of the built in collision detection/response works with it normally.

  • link updated

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's and old capx experiment of mine that may give some ideas.

    https://www.dropbox.com/s/df8jtstjva45m ... .capx?dl=1

    The cars don't really follow any traffic laws, they just go while trying to not overlap each other. It can fail when multiple cars enter an intersection at the same time, so some right of way is needed. The hack fix was to make the stop temporary and they'll eventually just drive over each other to keep things going.

  • It's "not equal to."

  • Just update winx and winy when you move the window with events and it will still be able to tell when a user moves it.

  • You'd have to test it and see how it performs on mobile. I've only tested the html5 export and I was never concerned with performance tests because this is just a wrapper to an existing js library.

    Also as with any third party plugin/behavior in C2 it won't work in C3 unless it's converted over. No plans to do so though.

  • angle(x1,y1, x2,y2) is the same as atan2(y2-y1, x2-x1)