R0J0hound's Forum Posts

  • Here is the closest I’ve come to that. It does a raycast from the mouse to a triangle mesh. The camera has a fixed fov and orientation.

    construct.net/en/forum/construct-3/your-construct-creations-9/3d-raycasting-obj-loader-test-167475

    Basically it’s all from scratch with math as construct doesn’t provide anything that helps. Getting the ray direction from the mouse involves the inverse of the view and camera matrices. Construct doesn’t expose those, maybe you can find them with scripting, or like in that c3p you can make your own from scratch that matches. To simplify the math I went with using a fixed camera orientation.

    Then it just does a Ray vs triangle calculation with a bunch of math. Construct doesn’t provide a way to access the mesh points or list of triangles so again, we have to build that ourselves and replicate the 3D objects with distort meshes.

    With just cubes I think things can be simplified a lot. We’d still need to calculate the Ray direction from the mouse but if we used signed distance fields (sdf) of boxes we could do the actual Ray casting a bit faster.

    Anyways, just thinking aloud here.

  • Events provide the most flexibility. JavaScript would be faster but is more quirky integrating with other construct features.

    Personally I have no interest in making plugins and the maintenance they require. Also they are inherently more limited by what features are provided.

    On face value it would make sense to tie this to the physics behavior but in practice it would be better to make something completely independent.

  • The cursor is set with the css cursor style. Probably it’s only set for the canvas element with that mouse action. So I think you’d either have to set the cursor for each html element or there may be a way to set the cursor for the whole page for every element. Although I’m not sure.

    developer.mozilla.org/en-US/docs/Web/CSS/cursor

  • If you setup the variables with different values, sure.

  • for each sprite3

    pick sprite2 instance loopindex

    pick sprite1 instance sprite2.animationFrame

    -- sprite3: set frame to Sprite1.AnimationFrame

  • That link really doesn't have any info how to do it. Most it says is the points only move along their radius line, but nothing else on how to make it match agario. The link to code is broken. It looks slightly different. Maybe the secret is to do a full on collision response between points and edges, so maybe another day.

    dropbox.com/s/ek59bdqrq71579v/blob_squish3.c3p

  • The end result is pretty much the same for either shuffle. I'm always on the look for a simpler way to do it.

    You can do that rearranging with just text like so:

    listA = "DCAB"
    listB = "3142"
    listC = ""
    
    start of layout
    repeat 4 times
    -- add mid(listA, find(listB, str(loopindex+1)), 1) to listC

    To do it with picking sprites it would be tedious. You can convert a row of sprites to text with:

    list = ""
    
    start of layout
    sprite: group=0
    for each sprite ordered by sprite.x
    -- add str(sprite.animationFrame) to list

    or you can use one of these in the add to list action if you want named frames

    mid("ABCD", sprite.animationFrame, 1)

    mid("1234", sprite.animationFrame, 1)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One idea is to check the points one the edges of the circles and move them out of other circles. It's not exactly the same but gives a blob like quality to the objects.

    Circles are done by using a distort mesh with a square.

    dropbox.com/s/5w7z6s6vmio4ztr/blob_squish2.c3p

  • I really don't understand. It seems to be the same as what the last capx does. I used the digits 0123 instead of ABCD mainly as a simplification. You can set the frame images to whatever.

    Anyways I had another idea on how to do the shuffling. Might me useful.

    Basically a1, a2 and a3 are the three answers. a1 is the correct one. ansIndex is a number 0-2 that offsets the order of the answers. The final step is to display the three answers by converting ABCD to 0123 to set the frames.

    Events 1-7 is enough to generate the answers. You can use any other solution to display them after that.

    dropbox.com/s/fusumitrtn0q3ya/shuffle_combinations2.capx

  • I fixed that issue so redownload. It should always show the answer sequence now.

    I don’t understand the first part of your question though.

    Best I understand you have want three four digit answers. One you can specify and the other two are shuffled versions of that.

    I had the digits start at 0 instead of 1, but all the numbers will be shuffled versions of 0123.

  • The second example does that. You specify the sequence in the global variable and it’s placed in one of the three groups of three.

  • To do what you want you mainly have to just rearrange the events you used in your original post:

    for each good
    bad: pick closest to good.x, good.y
    -- distance(good.x, good.y, bad.x, bad.y) < 200
    -- -- good: move toward bad
    -- else
    -- -- good: shoot toward bad

    But like the others suggested it can be good to put a bit more thought into the targeting. For example below I had each bad can be targeted by one good at a time, but that was mainly to prevent the good objects from overlapping over time.

    dropbox.com/s/a9a075lrxu45yjx/targeting_closest.capx

  • Ah, that's a bit different.

    Here's one way.

    dropbox.com/s/k4pdvewd4qbp4y8/shuffle_combinations.capx

    And modified if you want a specific combination included in the mix.

    dropbox.com/s/fv39mxvfsx41vsn/shuffle_combinations_with_a_predefined.capx

  • I suspect the issue has to do with the size of the drawing canvas.

    Don’t make it the size of the layout, just make it the size of the screen, and position it to the scroll position.

    You could make the draw reactance still cover the layout, or just make it cover the visible view area.

    Since it is visual effect you don’t need it to be bigger than the screen. Besides that will save video ram too.

    Anyways the reason the size of the canvas is probably causing your issue is the canvas is using a texture and webgl has a maximum texture size per device which is smaller than that layout size.