R0J0hound's Recent Forum Activity

  • With a varying time step what the y is when you add or remove the joint will vary, which is why the height differs.

    One way to have it repeatable is to use a fixed time step so the y position will be consistent. Of course the sim will run twice as fast at 120fps.

    I’m don’t think there’s much you can do with the builtin physics behavior to make it more repeatable.

    If you did the physics manually you’d have more control. Such as updating at a fixed rate and lerping in between steps. Or calculating the exact time to add the joint and use equations for the exact motion of a kinematic body and a pendulum.

  • The transparent part should be pretty straightforward. Make the bottom layer transparent and make the html div element the canvas is on transparent as well. You should be able to the have that div overlay the rest of the website. Anyways, that’s the rough idea and can give some points to google.

    Having input events pass through the canvas to the website below is another matter. Be default input is absorbed but there may be a way to let it pass through with JavaScript. Worst case you’ll have to manually remove event handlers the construct has by default.

  • Poor guy always seems to look like a smashed can after he falls.

  • It certainly is a sore point as projects get bigger. Would be nice if the editor could point us to those things but I guess having some dummy layouts to store global layouts and default instances is what we’ll settle with for now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This topic and the one I link to in it are relevant.

    construct.net/en/forum/construct-3/general-discussion-7/default-object-instance-159629

  • Sorry, this isn't on my radar for things I'm interested in doing currently.

    If anyone else is interested in attempting this it basically amounts to taking the official canvas plugin and changing the paste function to draw immediately instead of deferring to when the frame is rendered. Likely C3's renderer is designed to setup most of it's state when the frame is rendered. Also that is likely the point where any culling occurs. Both those things mean there will be some set up that will need to be done with care to not break what the render later expects.

    Overall I imagine it may be fiddly to setup, and probably has a high chance of breaking with construct updates. I'm more into one-off projects that only need to be updated for fun as of late. I'm less interested in something that requires a lot of maintenance and requires compatibility with most other construct features.

    Anyways, looks like a cool project. There's probably a way to utilize a canvas to do split screen, but not having it draw immediately is inconvenient (it basically complicates it). I haven't really used it but you could use two canvases to display the second screen. Basically any given frame one of the canvases would be on screen where you can see, and one is offscreen being drawn to. The only drawback is what you see will be one frame behind, which may be ok?

    Decided to test the idea:

    dropbox.com/s/pkjhiiaumiebo4t/split_screen.c3p

    Seems to work well, but like in C2 the tilemap won't draw tiles that are offscreen. In C2 the solution was to temporarily move the tilemap onscreen but I don't have a solution for C3. Likely particles have a similar issue.

    Anyways, cheers.

  • You're not doing anything wrong, most behaviors just aren't very robust when dealing with collisions.

    One solution is to use the physics behavior to handle the collisions. Just set the velocity of the player.

    Another way is to just handle collisions and collision response with events:

    dropbox.com/s/msb4cz5sqle5one/better_collisions_sdf.capx

    The above treats the player as a circle and works with boxes and circle walls.

  • So the qarp(a,b,c,t) expression is the basis for that. With one for x and y you will get a quadratic Bézier curve. A and c are the endpoints and b is a control point in the middle. Typically the curve will not touch the middle control point but newt is utilizing a little additional math to have the control point be on the curve.

    Anyways, the t is a value from 0 to 1 to get any point along the curve.

    Basically this is how you’d create points along the curve.

    Repeat 10 times

    — create at qarp(ax,bx,cx,loopindex/10), qarp(ay,by,cy,loopindex/10)

    Newts example draws lines between them with canvas and adds them as waypoints for the move to behavior to move along the curve. Conceptually you can think of the curve getting approximated by multiple lines that are moved along in series. That was done so the speed would be constant. If you alternately just changed t over time and used the qarp expression you could have a more precise curve but the speed would vary.

    The shape of the curve is limited by those three control points. You could use cubic() instead to get one more control point to give finer control. There are other ways to do curves between points too, but you’d have to write the whole equation out.

    All that in the example was just expressions. No js used there.

  • You can use the distort mesh to make it. This example is slightly out of date.

    construct.net/en/forum/construct-3/your-construct-creations-9/example-mesh-distort-sphere-161470

  • So basically you’d just need to set the z when you create it much like the velocities. For example here it starts with a z of -150. Then you can make it stop on the ground by comparing the z with 0.

    every 1 second
    — create shadow at random(640), random(480)
    — create ball at shadow.x, shadow.y-150
    — set z to -150
    
    Every tick
    — set y to self.y-self.z
    — set position to self.x+self.vx*dt, self.y+self.vy*dt
    — add 200*dt to vz
    — add vz*dt to z
    
    Z>0
    — set z to 0
    — set vz to -0.5*abs(self.vz)
    
    Every tick 
    — set y to self.y+self.z
  • You’ll have to refer to the documentation for how to do it.

    Basically you’d access the runtime object, find the list of object types from that, then a list of each instance for each type. Then you can either compare the x y or calculate the distance with:

    var dx=x1-x0, dy=y1-y0

    Math.sqrt(dx*dx+dy*dy)

    Or maybe the sdk has a distance function you can use. Anyways that’s the gist of it.