R0J0hound's Recent Forum Activity

  • Here is an alternate way. It checks the value with all the other values and if any match it randomizes the number again and re-does the check.

    dropbox.com/s/z0an316nusgc6nu/unique_random_list.capx

    If you were only concerned with the values 1 through 6 you could do something simpler like this too.

    dropbox.com/s/mb9he4ke03d7r23/unique_random_list2.capx

  • sir lolz

    Not with this plugin. The paster plugin supports that.

  • You have to loop over the array backwards.

    Var i=0
    Var count= Array.width
    
    Repeat count times
    — set i to count-loopindex-1
    — array.at(i) == 0
    — — remove array at index i

    Or you can

    Var i=0
    Every tick
    — set i to 0
    
    While
    i<array.width
    — array.at(i) == 0
    — — remove index i
    — — subtract 1 from I
    — add 1 to i
  • Idk, using a wave collapse function doesn't seem to keep everything connected.

    Here's an experiment with it. I don't think I provided enough tile cases since it can't resolve a few tiles. It was interesting to mess around with though. It probably could be made to erase those dead ends to try again. It would also be nice to give some tiles more weight than others.

    dropbox.com/s/grb9i41yhpy8uhp/waveFunctionCollapse.capx

  • First you find an equation to get the circle that goes through the three points, and then there was some extra math to transition from one angle to the other to plot points on the arc.

    dropbox.com/s/rwk6kjs9brx8myr/arc_through_3_points.capx

  • Probably can do it with a maze generating algorithm. Or something like that.

    en.m.wikipedia.org/wiki/Maze_generation_algorithm

    Edit:

    One possible way using prim's algo.

    dropbox.com/s/58l1kqgcdlse96x/primsAlgo.capx

  • It’s a special thing. There are many ways to do it.

    Here’s one possible way.

    construct.net/en/forum/construct-2/how-do-i-18/resize-handles-example-48892

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oops. I’ll need to fix that and reupload. You’d add it to the velocity update event.

    Set vx to (self.x-self.px)/step*damping

    Set vy to (self.y-self.py)/step*damping

    Let me know if there are any other features needed.

  • Ah, I see what you mean. You want damping. Re-download from my post.

    There are two ways you can introduce damping. One is to change damping from 1 to say 0.995. Another is to make the timestep bigger, so change step from 0.0005 to 0.005 or something. I had used a small step initially so that the balls would end up about the same height.

  • I agree with dop, seeing a project or at least a picture of your events would be helpful. Best I can guess it's likely some small logic or picking aspect you're overlooking with your events.

  • It’s no waste of time. It’s something I’m interested in and it was fun to try it.

    The gravity is handled by the “add 400*mdt” action. You can change the 400 to adjust the strength of it.

    I didn’t include mass, which would allow you to make things heavier. But that would only change things if you applied a force, impulse or deal with collisions or a joint between objects. As is, the joint with the layout and gravity would be the same regardless of how heavy the objects are.

    Anyways, if you wanted to apply an impulse and take mass into consideration you’d do:

    Add impulseX/mass to vx

    Add impulseY/mass to vy

    It’s best to not touch pTime. That would just advance the simulation forward in time more. It wouldn’t conserve energy.

  • Here's a simple test of event based physics that will update at the same rate regardless of the screen refresh rate. So motion of objects will be consistent.

    dropbox.com/s/c8ynrpg5ribps1p/smooth_fixedstep_physics.capx

    The physics is done with verlet integration, and uses a small step so it's more accurate and loses less energy over time. The position is interpolated between simulation steps to give smooth motion with different fps. I followed your example video and made it connect with a distance joint when below a certain point, and then remove the joint when above.

    Anyways, the physics is pretty bare bones. Objects falling with gravity with optional joints to the layout per object. More deluxe physics can be made depending on what's needed.

    For something simple like this we can go a step further by finding equations of motion so we get the exact path without energy loss, but that may be a bit of a overkill.