R0J0hound's Forum Posts

  • 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)

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've heard advanced random can generate a list of non repeating combinations but I haven't used it.

    Here's one way to generate an array of all the combinations. One idea more in addition to the other answers is you can store random(1) in the first column and then using sort(x) will effectively shuffle the array.

    dropbox.com/s/o2xmtjo8yqkid56/combination_shuffle.capx

    That just loops over that list of pairs which may be fine.

    An alternate idea is to just generate a random pair every time and check it against a history of the pairs of numbers. It will keep generating a random pair till it's unique. For example this is guaranteed to a not duplicate a pair of values for at least 5 turns.

    dropbox.com/s/xptgru4msx1rkz5/combination_history.capx

  • Ah, I see. Yeah, doing what you want is much simpler than what I proposed. I'd say still use the drawingCanvas. You can even use it to make the shadows from the objects directly.

    This clears the canvas, rotates the trees 221 degrees, pastes trees to canvas, return the trees to 0 degrees, then draws a black rectangle with the "source in" blend.

    dropbox.com/s/3noo9ie08ckvx6r/shadow_blend_simple.c3p

    Or instead of rotation, you could use distort meshes to make a skew.

    dropbox.com/s/qczxy22l8tr936s/shadow_skew.c3p