R0J0hound's Forum Posts

  • This will give you the maximum scroll value:

    max(0, ceil(count/4)-2)

    If you're setting the animations like this:

    For each inventorySprite

    --- set animation to array.at(loopindex+scroll*4)

  • ryguydavis

    By default the timestep for chipmunk is set at 1/30, so at 60fps the speed will be double. You can change the timestep to 1/60 for the speeds to be the same.

  • digitalsoapbox

    I've only tried a handful of the bundled effects with paster, but I was only aware of effects pasting wrong, not causing an error.

    I guess it can be marked as a limitation, as I've been avoiding working on any plugins lately.

  • Look at plugins list i think there was a couple path plugins.

    I haven't used the moveto plugin but I think you can use it to do what you want. Just put your list of points in a comma separated list and use it like so:

    Global text points="10,32, 100,40, 600,2"

    Global number index=0

    Global number goalx=0

    Global number goaly=0

    X=goalx

    Y=goaly

    --- add 2 to index

    Every tick

    --- set goalx to int(tokenat(points, index, ","))

    --- set goaly to int(tokenat(points, index+1, ","))

    --- move to goalx, goaly

    Or something along those lines.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could either a)check all the pixels with a loop, or b)set a variable when one of the actions to draw to the canvas is used. The latter is faster.

  • I haven't tried it in a bit but you may also need to wait a tick after setting the canvas size for scroll to to work.

  • If you want parabola movement you could use the qarp() expression

    Var t=0

    Every tick

    --- set t to time%2

    --- set t to (t>1)?2-t:t

    --- set X to qarp(a.x, (a.x+b.x)/2, b.x, t)

    --- set y to qarp(a.y, (a.y+b.y)/2-variance, b.y, t)

  • Here's a better approach I found after the link above.

    You set the viewport size to the size you want.

    Next scroll to the center of what you want to capture.

    Then use the snapshot canvas action.

    When it's done you can then set the viewport back to normal and scroll back so it's centered.

  • Setting the ball's bullet setting to yes should fix the ball going through the paddle.

  • It would be a nice feature if you could use a string to set the color instead of a number, since the rgb() expression just returns a number.

    I guess in the meantime you could make a function like this to convert a rgb string to a number.

    on function "rgbText"

    --- set return value to rgb(int(mid(tokenat(function.parameter(0), 0, ","), 4, 3)), int(tokenat(function.parameter(0), 1, ",")), int(tokenat(function.parameter(0), 2, ",")))

  • Just guess but by default the stepping mode is fixed which means the timestep will be the same for every frame. So if the actual dt varies a lot frame to frame you'll get that jerking. You can change the stepping mode to variable which should help eliminate that.

    If it doesn't help then I'd guess an object with the bullet behavior moving at the same speed will have similar jerking. It's something that has come up before, and it's caused by how the browser used deals with your current hardware.

  • In construct classic arrays are 1 based as I recall. So the first element would be index 1 not 0.

  • Aldo

    Here's one way to do it. Basically loop over them and save the iid of the Sprite at the end of the loop so we can access it too at the next loop iteration using the sprite(1).x type syntax.

    Global variable prev=-1

    For each dot ordered by dot.x ascending

    ---- compare: loopindex>0

    -------- draw quad (dot(prev).x dot(prev).y, dot.x, dot.y, dot.x, 300, dot(prev).x, 300)

    ---- set prev to dot.iid

    An alternate way would be to store the positions in an array instead of that picking trickery.

    The quad points start with the top-left and go clockwise from there.

  • Not easily at least.

    You can take the positions and generate a layout.xml file using a layout xml from your capx as an example. So you'd save the generated file somewhere, close your project in c2, and assuming you had saved your project as a folder you can replace one of your project's layout xml with the one you generated. Unless there's a mistake in the xml that was generated.

    Anyways it's probably a tedious thing to do initially, and the step requiring you to manually replace files is a slow workflow.

    A more reasonable thing to do would be to save the generated positions to some text, and then put that into your game and recreate the objects from that.

  • It's just an alternate idea of one doesn't want to use a third party behavior. Chipmunk does also recreate the shape but the velocity is retained. There isn't a crash if you do it continuously. All the old shapes should be cleaned up by the garbage colllector.