R0J0hound's Recent Forum Activity

  • No idea really. I’m a hobbyist not a freelancer.

  • I’m not for hire but ideas are free.

    There are some example on the forum of fracture by just creating premade pieces and destroying the original object. Also there should be an example somewhere of object slicing. Maybe in a fruit ninja question.

    The meat of it is being able to clip a polygon by a line, polyline or another polygon. That basically amounts to keeping a list of points of the polygons and calculating intersections of line segments and testing if a point is inside a polygon or on either side of a line. You’d want all the polygons to be convex

    To draw the polygons you could use a drawing canvas or use a distort mesh. The distort mesh is better in that it has collisions and is textured.

    After that it’s just a matter of defining how you want it to fracture. Start with just drawing the fracture pattern you’re after. Then you could just use the polygons from that to do the clipping or you could try to procedurally try to generate similar patterns.

    For a super realistic fracture you could define the density of the object as a varying noise texture then doing some kind of pathfinding through that to make the crack. But that’s probably slow and excessive.

  • You can try:

    System -> object overlaps point

  • On the construct community discord there is skymen, mikal and Federico that have made effects, but c3 mostly.

    I’m no longer interested in any aspect of addon development but I can give general information.

    The fx file is glsl not js but it looks similar.

    The scrolling is probably done by shifting the texture coordinates its sampling from.

    Maybe: tex=mod(tex+vec2(offsetX,offsetY), 1)

    But that only works right if the image isn’t spritesheeted.

    To make it work you need the top left and bottom right texture coordinates. It would look similar to this but the names of the values may be different.

    tex = mix(texTopLeft, texTopRight, fact((tex-texTopLeft)/(texBottomRight-texTopLeft)+vec2(offsetX,offsetY)))

    You’d need to look up the correct names of things from the docs I think.

    Anyways I’m assuming a bit here. I haven’t looked at the effect. I’m not available to actually try doing it with the effect, but it’s the rough idea of a possible fix.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The question is far too general. You can go through some beginner tutorials to get the basics down.

    Or if you say what you’re trying to do, and show the events that aren’t working for you then maybe someone can probably give more specific help.

  • I don’t mess with effects but likely the fact images are put into spritesheets when exporting is throwing it off.

    The effect probably needs to be fixed so it wraps the texture coordinates around the sub texture instead of the whole texture.

    A workaround is to load the image at runtime. That way the image isn’t spritesheeted.

  • Changing the playback rate changes the pitch. For example I have used the sound for one piano note and got any other note by changing the playback rate.

    On the JavaScript side in addition to playbackRate there’s a PreservePitch setting which controls whether the pitch will change with the rate or not. In construct at least it’s off so changing rate changes pitch.

  • Cool stuff

    Programming makes math way more fun since it’s a way to apply it.

  • What kind of ideas are you after?

    To draw stuff use the drawing canvas.

    To mask stuff use a blending mode. Blending modes can be used while drawing and you could use multiple canvases. Draw to one then paste it with a blend mode onto another one I guess.

    Freehand drawing tool? Just draw to the mouse location when the button is down every tick. To fill the gaps when moving fast you’d also draw a line or rotated rectangle from the previous mouse location to the current one.

  • That sounds messy to have all the possible enemy attributes as family instance variables. You probably just want attributes common to all enemies to be in the family and the attributes specific to certain enemies as instance variables of that type. Instance variables overall are the cleanest way to store values per instance.

    When you add a dictionary you only get one. To be interchangeable with instance variables you’d want a dictionary per instance, but that’s not super straightforward to do and can make events look more busy.

    You can put an object type and a dictionary in a container to have one per instance, but you can’t create a container with a family. Containers let events automatically pick the paired dictionary when you pick a sprite.

    Another more manual way is to create a dictionary whenever you create a sprite and store the dictionary’s uid in an instance variable of the sprite. Then you’ll need to pick the dictionary whenever you want to access it in events. You’ll probably want to pick and destroy the dictionary when you destroy the sprite too. This is useful in some situations but generally it makes events harder to read.

    So apart from having values per instance.

    Variables are nice since they are named and let you catch typos as you write them. They are also cleaner looking to use over dictionary keys.

    Dictionaries are accessed by a text string so it’s up to you to avoid typos. Accessing a value with a name you didn’t add to the dictionary will just silently give you a zero which can be a tricky to notice. With a dictionary you can also add things on the fly but that has limited usefulness. It also lets you access values by name if that’s important.

    Overall using variables or instance variables are the way to go, especially if you have values per instance.

  • Here's an example of it. It corrects the position and the velocity. Seems to work alright with collisions if you add them. In C3 at least if you enable wall sliding.

    dropbox.com/scl/fi/sflsjyje1eqwgtxhk9qjb/tetherObjects.capx

  • Here are some ideas.

    You can start the array with all 50 numbers in order. Repeat 50 times->set at (loopindex) to loopindex+1. The you can repeatedly swap values at two different locations. The shuffling would be done like this.

    vars i0,i1,tmp
    repeat 100 times
    — set i0 to int(random(50))
    — set i1 to int(random(50))
    — set tmp to array.at(i0)
    — array: set at i0 to array.at(i1)
    — array: set at i1 to tmp

    Another idea would be to take advantage of the arrays sort action to do the shuffling. You’d set the array size to 50x2, and the first column would be a random value and the second column the number. You’d populate it with:

    repeat 50 times
    — array: set at (loopindex, 0) to random(1)
    — array: set at (loopindex, 1) to loopindex+1

    Then you’d use the sort action. Then you can probably remove the random column with a delete action on the y axis.

    A third option could be to use 50 instances of a sprite as an array instead of the array object. You’d create 50 instances and you’d be able to access it like an array with sprite(n).value. To populate it you can do: for each sprite ordered by random(1) -> sprite: set value to loopindex+1.

    You also could look at the advanced random plugin since it may be designed for that sort of thing.

    To limit the value 25 to be after index 20 you’d probably want to check where that value was with the array.indexof expression, then either just re generate the array again to see if it’s better or just swap it with a value elsewhere with basically the swap idea above.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound