R0J0hound's Forum Posts

  • Yeah, that’s correct. You’d just check to see if totalRotation is a multiple of 360.

    Edit:

    Cool. Glad the other suggestion was useful.

  • No, you just have to recreate it in C2 manually.

    The main issue is not all construct classic features are available in construct 2. As well as many things just work different. There is a python library capReader.py that I posted here before that mostly let’s you access all the data in construct classic projects. And I briefly was attempting to utilize that to make a converter, but it determined it wasn’t worth working on further.

    Remaking the project is the only practical way. Especially since you’ll have to do many things differently.

  • Another way to measure the amount the wheel rotated is to use a signed angle difference. It’s like the anglediff(a,b) expression but is negative if counter clockwise.

    angle(0,0,cos(b-a),sin(b-a))

    Will work as long as the rotation is less than 180 in a frame. You could also just use anglediff in this case I suppose since the wheel is rotating only one way.

    TotalRotation=0
    PrevAngle=0
    
    Every tick
    — add angle(0,0,cos(wheel.angle-prevAngle),sin(wheel.angle-prevAngle)) to totalRotation
    — set prevAngle to wheel.angle
  • One way would be to calculate how long three rotations would take from the speed. There’s a general formula rate*time=distance which you can think of as angularSpeed*time=numberOfDegrees. Just solve for time, time=numberOfDegrees/anglulareSpeed.

    Anyways, here’s a possible way to utilize that. It just takes two variables: speed and deceleration.

    On click
    — set speed to 500
    — set deceleration to 0
    — wait 3*360/speed seconds
    — set deceleration to 100
    
    Every tick
    — set speed to max(0, speed-deceleration*dt)
    — wheel: rotate speed*dt degrees clockwise

    You can set speed to whatever you’re doing now to set the speed.

  • Here’s an old example of a way to do it with an array. Json would be pretty similar.

    construct.net/en/forum/construct-2/how-do-i-18/replay-meatboy-55099

  • Soft body physics for things such as jello are always cool to mess with. Every so often I try to find ways to do it better. Typically they are done with a grid of points connected by springs. The only downside is they can collapse on themselves sometimes. But the following corrects that by having it try to keep the same area from one frame to the next. The result a very robust simulation that doesn't break.

    Here is an example using the paster addon, and one without 3rd party plugins that doesn't distort images.

    dropbox.com/s/ikcd3sxj9eowomg/jello_paster.capx

    dropbox.com/s/zj51hzstahv0f8n/jello_no3rdParty.capx

    dropbox.com/s/ray56gskqwpiwfy/jello_c3.c3p

    Edit: ported to c3 as well. It fit within 25 events.

    Cool reference:

    matthias-research.github.io/pages/tenMinutePhysics/index.html

  • This post is relevant:

    construct.net/en/forum/construct-3/general-discussion-7/coeficient-accept-more-167339

    It can go from 0 to infinity according to the box2d manual.

  • Not sure if it’s intentional, but once it deforms too much it takes on clay like properties which is pretty cool in its own right.

  • Maybe move the textbox when clicked on or change the scroll so it stays onscreen. That’s what I’d try.

    As an alternate you could try the js prompt() function to get input instead of using the textbox.

    w3schools.com/jsref/met_win_prompt.asp

    Anyways, just ideas.

  • Wouldn’t using the action:

    Set css style "transform" to "rotate(90deg)" work?

    Seems to be supported on most browsers.

    caniuse.com

  • I think when an action takes an object as a parameter it's not picky what kind of object.

    Form objects actually float above the game canvas so they don't draw. I think the only workaround for that is to somehow draw the form controls on the canvas. You can do that by setting css opacity to 0 and doing the drawing by other means. However, there seems to be quite a bit of nuance to draw the same.

    Here's a test of hiding the inputbox form and displaying it by other means. Needs work when more text is displayed, but it may give ideas.

    dropbox.com/s/5xygyt0uo5zyz96/hidden_input_form.capx

    A simple solution would be to limit the number of characters?

  • You can think of vertices as just points. Most 3d modeling programs use that term.

    Anyways UVs are just texture coordinants. Much like XY give a location on the layout, UV gives a location on a texture. UVs go from 0 to 1. Say this square is an image, the following shows the UV of each corner.

    (0,0)
    +----+ (1,0)
    |....|
    |....|
    +----+ (1,1)
    (1,0)

    Since UVs are in the range 0 to 1 this is called normalized coordinates. It's useful as opposed to pixel coordinates because it works for any image size. If you want to use pixel coordinates you can convert it to uvs with (x/imageWidth, y/imageHeight).

  • Hi,

    Making the distortions better is out of the scope of this plugin. Mayne it's solvable via a shader or utilizing perspective correct texturing. Both would require a fair amount of shenanigans to be able to do that within C2's renderer. One half solution is to subdivide into smaller quads, and perhaps changing how the quad is made out of triangles could give some improvements. The latter could be done by rotating the order of the vertices as needed. Could be something to experiment with.

    As is the distortion works well with scaling, sheering, or rotating. Perspective isn't possible with affine transformations without hacking the renderer to be 3d or some special case shader.

    For your second question you can do that with uvs. Just set the xy and uv of all four vertices and use the "draw quad with uv" action.

    dropbox.com/s/ganjw6d7v7i43ab/paster_Tomycase.capx

  • Apparently that execCommand function is deprecated in browsers now, and the following is the new way. The docs indicate it won’t work in a webworker and needs the website to be https.

    Execute js "navigator.clipboard.writeText('"&Textbox.text&"')"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is the latest version of using distort mesh to make a sprite into a cube and rotating it by x,y and/or z. The angle, angular speed, and size of each cube can be set with variables.

    construct.net/en/forum/construct-3/your-construct-creations-9/example-mesh-distort-sphere-161470