R0J0hound's Recent Forum Activity

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Cape/cloth physics is much like rope physics. Basically it’s made of a bunch of point that have velocity and fall with gravity. Then you keep track of the distances between pairs of points, and move them closer toward each other if they are too far away.

    Anyways one way is to use the physics behavior and connect them together with joints.

    Another is to use event based physics. Look up rope or cloth physics for examples.

    In c2 you have a third party plugin like paster to distort the image. Or you can just fake it with sprites.

    As far as the simulation itself you’ll just have to tune parameters. Maybe more air resistance or less gravity. A more elaborate sim might do the physics in 3D, or limit not only the distance between points but the bending angle. Also another idea is to make the air drag depend on the angle of the parts of the cape, probably a lift/drag model like planes use. Finally adding collisions with the player or with other parts of the cloth itself could look cool. It just depends how deep you want to go.

  • A lot of browsers have an option to disable webgl2 so you can utilize that for easy testing on your system.

    To make the export use just webgl1 you can edit the runtime after exporting. Just look for .getContext(“webgl2”) and remove the 2.

  • Yea, I’m pretty sure that was where the NaNs come from.

    Glad the idea works

  • With 3D the mouse plugin and probably touch will give you a point on the 3D ground plane. This isn’t always useful though.

    Typically you’d want to add a 2d layer and grab the mouse/touch from that so you get standard 2d values.

  • It’s system->compare two values

    With loopindex as the first value and 1 as the second.

  • I’ve found wait 0 is more like, run at the end of the event sheet.

    You can test that with something like:

    Var prev=0
    Every tick
    — set prev to tickcount
    — wait 0
    — subtract tickcount from prev
    
    Compare: prev =0
    — set text to “same tick”
    Else
    — set text to “another tick”

    And yes, wait should pass the selected object list to when it’s done.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound