R0J0hound's Recent Forum Activity

  • I’d imagine so. The canvas is just a textured quad.

  • If you’re setting the angle of the sprite then I’d recommend the first method dop posted.

    The lerp gives an ease in but you can have the rotation at a constant speed with:

    Set angle to rotateAngle(self.angle, self.simAngle,100*dt)

    If could also do multiple conditions to see is the one angle is clockwise or counter-clockwise along with the angleDiff(a,b) expression to get the direction and angle difference.

    For a pure math way you can do this with the two angles which will give the difference and clockwiseness.

    signedAngleDiff=angle(0,0,cos(a-b),sin(a-b)

    Abs(signedAngleDiff) is the distance

    signedAngleDiff<0 means a is counter clockwise from b

  • Best I can come up with is a custom solution. Basically we’ll need a way to follow a path even if the object is pushed off the path. The path finding behavior kind of has a fixed path that the object follows so that’s not usable as is.

    If the units are moved with say the physics behavior they can push each other out of the way. Then to move along a path you change the velocity as needed. It’s simpler said than done but the concept is called “steering behaviors”. There’s one that steers to follow a path but I haven’t implemented a working solution of that yet. Another idea is to divide the map into a grid and do a flood fill from the goal to the other grids. Each time you store the direction from the previous grid position. So what you essentially get is a path from all grid locations to one. Then you can just set the velocity based on where the object is positioned.

    There are other solutions too. But nothing super simple comes to mind with the tools construct provides.

  • I’m unfamiliar with that template but would this work?

    construct.net/en/forum/construct-3/how-do-i-8/anybody-know-something-this-173033

    It positions the camera a bit behind the player and looks at a bit in front of the player. I adjusted it so that the player is on the bottom of the screen but you can tweak it more.

  • Here’s one way. Is one color at y=0 and the other at y=480.

    t= sprite.y/480

    Set color to rgb(lerp(23,72,t), lerp(24,104,t), lerp(25,89,t))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Currently it takes all the polygons facing the light, loops over each pair and casts shadows on each one. Kind of brute force but I should work on any mesh.

    The meat of it is clipping a polygon by a plane. Then a shadow is cast on one polygon (A) onto another polygon (B) by taking all the edges of A and making plane with the light position, then clipping B by all those planes.

    An improvement would be to use a a binary space partition in conjunction with that to do that more efficiently so higher speeds with more polygons is possible. Google SVBSP (shadow volume binary space partition) for the algorithm.

  • I suppose you could. The binary object would help in decoding rom files. What did you want to try to emulate?

  • To address the mass not being taken into consideration:

    Force = mass * acceleration

    The units with the physics behavior is off by a factor of 50 or so. In practice that only matters if you want to use exact units. Most of the time you can just tune the numbers.

    There is no solution for the sleeping with what the physics behavior provides access to. If you can somehow access the underlying physics engine from JavaScript there may be a way to do it, but the behavior wasn’t designed for that, and you’d be fighting with the behavior.

  • Setting a 3d camera and using a fog effect should be enough to do it.

    Here I made the camera be a little behind the car and look at a little in front of the car.

    dropbox.com/s/thbtrfjyauqk9rn/mode7like.c3p

    For the 3d looking car it's probably just a car sprite on a 2d layer.

  • So I managed to to make a demo of realtime shadows between two cubes an a ground plane with a point light. It's using the shadow volume method using polygon clipping.

    dropbox.com/s/f9x1ov9fy7y7bpr/3d_shadow_volume.c3p

    You can drag the cubes if you click on the the middle of them. The fireflies in the shadows are from Z-buffer precision limits. The edges show sometimes as well since the shadows are offset slightly to reduce z-fighting.

    To fit it into 25 events it's currently limited to just the two cubes and ground plane. However I think I can see at least one more event I can squeeze out of it so we could have any number of cubes after some refactoring, but that's for another day. Overall it was an interesting test, but to make it simple to use in general would require a lot more work.

    Anyways, cheers!

    EDIT:

    made it so you can add as many blocks as you want and added block color.

  • Oh, strange. I would have thought a higher refresh rate would make collisions more accurate. It's the lower framerates that could cause objects to pass through walls.

    Sounds like a bug if collisions are failing at higher refresh rates. Ashley

  • Off hand you could make some functions that would both call console.log and write to a variable. Then you could invoke a download of that variable to a file.

    I suspect there is no direct way to access the debug console contents since this is JavaScript and browsers limit what data you can reach for security reasons. Google may prove me wrong though