R0J0hound's Forum Posts

  • Simplest would be to just make an animation to do that. More complex would be to utilize distort meshes to make a piece of the object. You’d have to duplicate the sprite for each piece. Then set the mesh point xy to the edge of the shape used of the piece and the uv so that the image isn’t distorted. Doing that in a dynamic way is probably too complex so you could use a 3d modeler to chop up a quad into fragment polygons. They should be convex but you can have concave polygons in some cases. I think I’m only scratching the surface on how that could be done. There’s a lot of busywork and smaller puzzles to solve. So again it’s probably easier to do an animation or just draw the smaller prices. Or you could draw the object to a canvas and use a blend mode to mask out the part you want.

  • Should be the same with the same file. But I don’t know what the editor is doing. Anyways, keep at it. Maybe you’ll spot the difference. I’m not at a computer so I won’t be able to help.

  • I can’t debug it. So if it’s the same file I’m guessing it should give the same result as the hex editor. If it’s completely different then it seems like a different file or something is completely off.

  • Just use a grid hash or a AABB tree or something if you want it to work with objects being positioned anywhere. Or since you’re building the quad tree on the fly you could guess the bounding box of all the objects, build the quad tree and anything out of bounds is put into a simple list and the correct bounding box size is calculated for the next frame. If things are moving the new bounding box would still be a guess but it would be pretty close.

  • Roughly you’d load the file into the binaryData object instead of text. Then you can access individual bytes. You’d have to convert the byte value to hex to display as text. Then after changing the hex text you’d have to convert back.

    So something like this.

    Start of layout
    — Ajax: set response to binary BinaryData
    — Ajax: request url “” as “data”
    
    Ajax: on “data” loaded
    Repeat BinaryData.ByteLength times
    — text: append function.byte2hex(BinaryData.GetInt8(loopindex))
    
    On function: updateBinaryFromText
    — repeat len(text.text)/2 times
    — binaryData: set int8 at loopindex to function.hex2byte(mid(text.text, loopindex*2,2))
    
    
    On function: byte2hex
    Parameter byte
    — set return mid(“0123456789ABCDEF”, int(byte/16),1)&mid(“0123456789ABCDEF”, byte%16,1)
    
    On function: hex2byte
    Parameter hex
    — set return to find(“0123456789ABCDEF”, left(hex,1))*16+ find(“0123456789ABCDEF”, right(hex,1))
  • Basically this?

    function hex2dec(hex)
     — var num=0
     — repeat len(hex) times
     — — num = num*16+max(0, find(“0123456789abcdef”, mid(hex,loopindex,1))
    — return num

    Btw your example is odd to me. W isn’t a hex digit.

  • Some tests of different physics integration methods with different timesteps. I included the platform behavior too to compare, but it just uses whatever dt currently is. It draws a nice graph to compare time vs y. The speed of the jump has to do with the timestep used, so it can be ignored.

    https://www.dropbox.com/scl/fi/sluu3khqb1b0vzw5de0lu/integrationTests.capx?rlkey=0jjkfkcaww1evb03bs4fj9mpu&dl=0

    The results show that leapfrog, velocity verlet, and the platform behavior in c3 all have matching curves.

    You could do similar tests for the 8dir behavior vs an event based one.

  • It’s on Wikipedia.

  • The verlet you’re thinking of is slightly different. It infers velocity from position change which does work well for ropes and cloth.

    Anyways it’s something you can test either way.

  • Your math is off I think. Should be:

    (ScreenWidth-windowWidth)/2

    But You’re doing:

    (ScreenWidth-windowWidth/2)

  • Looks like that method is called leapfrog integration. It averages out changes to acceleration from frame to frame.

    Most behaviors use velocity verlet integration. Which handles constant acceleration motion perfectly no matter the timestep.

    When acceleration changes from frame to frame I don’t think there’s a silver bullet integration method to make it frame rate independent.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mean something like this?

    Repeat 4 times

    — dx= round(cos(loopindex*90))

    — dy= round(sin(loopindex*90))

  • One way would be to only change the variable with a function or custom action. So when you call that you’d know the variable is getting changed.

  • Functions in c3 have a fixed number of Params so param count doesn’t exist.

    One solution is to just use the old function object instead of the new built in ones. Just find an old project with the function object and copy it over.

    Another is to just make it with the new functions. Add the function, give it two parameters, and replace function.param(0) and function.param(1) with the parameter names instead. And instead of using function.paramcout use 2, since there are just two parameters. You can then simplify from there if you like.

  • It depends on the event. Generally you can’t have a trigger as a sub event of a trigger. You can have a trigger of normal filtering events. But it looks backwards, and actually it works as if the trigger came first and then the filter.

    Anyways it makes sense to have the triggers first and other stuff under it. Guess it depends on what event you’re wanting to put the key trigger under.