R0J0hound's Recent Forum Activity

  • I read a bit more on it.

    With decibels, 0 is full volume and about -80 is sufficiently quiet to be considered silent. Subtracting/adding 6db will half/double the volume.

    So far so good. But using 20*log10(percentage) you get the same result:

    Full volume (1) will give 0.

    Half volume (0.5) will give -6.

    Quarter volume (0.25) will give -12.

    Either seems viable to setting volume and you can convert between the two and get expected results. The underling webaudio api uses percentages for volume.

    Anyways, it’s merely a preference. People who have done a lot of audio processing seem to prefer decibels and a lay person like myself likes percentages.

  • Still whenever making a volume slider it’s still needed to convert a percentage to decibels. 0db is full volume and -infinity is silent.

    Db = 20*log10(percent/100)

    Does that. At least it’s correct at those two points.

    Guess you could do the volume slider like this if one wants to stay in decibels. The -1000 is arbitrary though. Technically should be -infinity to be silent but at some point it’s probably quiet enough but that would have to be found by trial and error.

    Db = lerp(-1000, 0, percent/100)

    Anyways my opinion still stands about decibels and percentages. Percentages are more intuitive to me. Decibels have their use for sure but I haven’t found them useful for my purposes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here’s a post with the formula to convert a percentage 0-100 to decibels. I never understood why this was the default since percentages are way more intuitive and actually is what webaudio uses behind the scenes.

    construct.net/en/forum/construct-3/how-do-i-8/user-change-volume-percentage-162705

    If I understand how you’re selecting the volume with a click you should be able to get a percentage with:

    100*(mouse.x-bar.bboxLeft)/bar.width

    Then just convert that to decibels with the formula in the link above.

  • I can't tell what you're trying to do exactly from your description and screenshots.

    You say the blocks fall, and you drag and drop them into predefined places.

    But from the last part of your paragraph you want to pack blocks inside an area.

    I'll venture some ideas how you can pack blocks inside an area.

    One is to start with a block the size of the area and split it up into smaller blocks.

    dropbox.com/s/f5h6gh9b3znuqqc/block_split.capx

    Another, which is a bit simpler is to start with a grid of identically sized blocks and merge them together here and there to make the bigger blocks.

    In this one I made it so you can drag blocks onto the grid which snap into place.

    dropbox.com/s/r0ejucffa5a9ue2/block_merge.capx

    Also here is a way to drop blocks on top of each other. But this is a loose packing. The only limit I added was the sides of the screen.

    dropbox.com/s/gsoi09vjspxtx0d/block_fall.capx

    There are probably other ways to do these things too. I don't think any of those are exactly what you were after but some of it may be helpful.

    In general if you break down what you want to do exactly you can then find ways to implement it inside construct's tools.

  • Lots of nice examples! Think there is a lot of room for different approaches, it just depends on what look you're after.

    Here's a test of doing the body with rope physics. It also adds a stiffness to the rope to make it try to stay straighter. Looks like the dragon is struggling against gravity now, so that was satisfying. Also added a knockback when it shoots fire and as a side effect the body gets a jolt that goes through it.

    dropbox.com/s/gvfmn6eohn2lojt/bone_snake.capx

  • Just guesstimating from the image since I wasn’t able to find footage of it in motion.

    But it looks like it’s basically the same as doing rope physics. The ends are fixed and everything in between sag with gravity. There are other posts on that but the method I’m fond of is to make all the non fixed segments accelerate downwards, then starting at base check the distance between each pair of segments and move toward each other if too far apart. A last step would be to update the velocities after that position correction. That may not be Strictly needed, depending on whether you wanted momentum or not.

    So anyways you’d have the head move on a path, then the body would move with the rope physics. Maybe letting it move the head so it can’t stretch too far.

    Beyond that there may be some more artistic setup with it. Instead of a limp rope between the head and base there may be a way to make some sections more stiff to simulate contracting muscles. That or just adding a lot of damping to the motion so it doesn’t seem as loose.

    I’d wager they did something more simple than all that though. For example you could position the body segments between the head and base with cubic() to make them curved. You just need two other points moving around too to define the curved shape. The gaps between adjacent segments may vary though.

    I suppose you could also do it by varying the angle from one segment to the next with a formula of some kind. It would require some tuning as the final head position would be defined by it, instead or the more direct approach the other ideas have of moving the body between the head and base.

  • The canvas plugin lets you draw objects onto it. If you’re able to draw the video onto the canvas you can then read pixels.

    That in and of itself doesn’t give you collision detection. Construct works with polygons, not pixels to collision detect.

    What you can do is read say 100 random pixels and create some square objects at each one if it’s on the cat. It would be enough to mostly detect collisions with the video, but it wouldn’t work well for having the cat in the video be able to push the player around.

    So in order to do that you’ll need to.

    1. Be able to draw a video on to a canvas.

    2. Read pixels from the canvas.

    3. Be able to tell if that pixel is on the cat or not. It’s easiest if the background is a certain color.

    Reading all the pixels and creating collision objects every frame would be pretty slow, so that’s why I suggested sampling 100 random pixels. The idea is just to get an approximate shape.

  • Sub events are only run when their parent event runs. Anyways here it matters because or the else’s. An event with an else will only run if the event on the same level above it doesn’t run.

  • Make event 9 a sub-event of event 8 and it works.

  • Well the input events are run top to bottom.

    You have it so if you tap on either red circle it closes the menu, then third event runs because it’s not tapping on anything.

    I thought maybe rearranging the events would be an option but that causes the menu to be instantly destroyed so you don’t see it.

    But here’s this for a solution. Have one on tap event and have it do just one thing depending on what was tapped on.

    on tap
    -- touch is over sprite1?
    -- -- close menu
    -- else
    -- touch is over sprite2?
    -- -- close menu
    -- else
    -- — close menu
    -- — create menu
  • Cool that you reposted it.

    I’ve replied to topics before only to have the topic later deleted. Which is kind of a bummer especially if the reply was detailed.

  • My apologies then, I’m not really being helpful with the request.

    I just work around stuff.