R0J0hound's Recent Forum Activity

  • The mouse behavior doesn't have that ability, it's not really something webpages allow.

    If you use nwjs you could look at its plugin for an action to do it. I haven't looked.

    There is also a third party plugin called mouse lock that may be of use to you. You should be able to find it in the third party addons list.

    Barring those the only other avenue for a solution is using nwjs and finding a way to make access the mouse position there with either JavaScript or some nwjs specific plugin. It's not really a quick solution at all and would require research to do.

  • Physics objects are touchy about being moved with the set position action. It confuses the physics engine when things suddenly teleport.

    Anyways, I haven't done it in a bit but you should be able to keep the velocity by:

    1. save the the velocities to variables.

    2. move the object.

    3. wait a tick and set the velocities from the variables.

    Or just use the chipmunk behavior, it doesn't have that quirk. You can just simply move stuff without issue. Anyways either of those should fix the relocation issue.

    The objects raining from the sky is probably from them being launched there from off screen overlapping objects.

  • That's all of it? I'm not clear what you have that's 40mb, but that isn't it.

  • Maybe look at the json and see if anything is amiss?

  • How would someone know? Saving a empty 1,000,000 element array to json is ~ 6Mb. Setting each value to 1234567890 first will make the json 16Mb. So the size of the json will depend on what's in the array.

  • You could try moving the overlapping condition above the variable comparison. But you'll probably get better results from changing your logic.

    When do the sprites change? If they only change one at a time you could just update that line instead of all of them.

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound