R0J0hound's Forum Posts

  • Here's a function to take an object by uid and move it behind another object by uid.

    It handles sprites and tiledBgs but hopefully you can see how other plugin types could be added.

  • You can do this:

    1. save the x,y of the clicked object in some variables.

    2. pick all the sprites and check if the points overlap a sprite at offsets x+32,y x-32,y x,y+32 x,y-32

    3. If all four offsets pick a sprite then don't destroy the clicked object.

  • Somebody

    Oh cool, thanks for the icon.

    With the Draw Quad action the first coordinate in the top-left and the others are in clockwise order.

    So top-left, top-right, bottom-right and bottom-left.

  • Somebody

    You can do that. The only thing to consider is each instance will have it's own texture. It's not really an issue unless you run out of video memory.

  • Irbis

    The "load from url" action is not instant so you can't paste right away. You either would have to do it after a wait or under TiledBg's "on image url loaded" condition.

  • A simple effect to adjust the hue of a image.

    Using the code from here:

    http://gamedev.stackexchange.com/questi ... brightness

    Why not use the HSL shader that comes with C2?

    My graphics card can't handle that shader.

  • Just drag a global variable to a sub-event of something

  • tgeorgemihai

    I mean putting the "pick all solidWall" in between you overlap conditions.

    So instead of what you have now:

    PlayerAheadLeft is overlapping solidWall
    PlayerAheadRight is overlapping solidWall[/code:27k6r58q]
    
    Do this for all 4 of your events:
    [code:27k6r58q]PlayerAheadLeft is overlapping solidWall
    Pick all solidWall
    PlayerAheadRight is overlapping solidWall[/code:27k6r58q]
  • Not as soon as it's added, just when you need to do the time calculation. Now you could convert it to minutes or hours just as easy. So for example you could do this:

    TotalMinutes = 0

    ListText = "0230-0420"

    time1 = tokenAt(ListText, 0, "-")

    time2 = tokenAt(ListText, 1, "-")

    minutes1 = int(left(time1, 2))*60 + int(right(time1, 2))

    minutes2 = int(left(time2, 2))*60 + int(right(time2, 2))

    TotalMinutes = TotalMinutes + minutes2-minutes1

    Set text to zeropad(int(TotalMinutes/60), 2) & TotalMinutes%60

    Which would give your result in hours and minutes or "0150".

    If instead you want it display the total minutes in hours you can do this:

    Set text to TotalMinutes/60

    which would give "1.83333333'

    Or if you always just want only two decimal places you can do this:

    Set text to int(TotalMinutes/60) & "."& zeropad(int((TotalMinutes%60)*100/60), 2)

    which would give "1.83"

  • So the first two digits are hours and the second two are minutes. So you could convert a string like "0245" to a decimal hours with:

    Int(Left(text,2)) + int(right(text,2))/60

    Which will give 2.75

    In simpler terms it's just this:

    Hours + minutes/60

  • The canvas and paster plugins allow you to create your own images.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tgeorgemihai

    For that you could add a pick all solidWall condition between the overlap conditions.

  • Ok, here's two examples, one using the physics behavior and one using the chipmunk behavior

  • I've done that before without the physics behavior here:

    It can be done with physics but the torque calculation needs the object's inertia

    torque = inertia*angularAcceleration.

    But for that you'll also need to manually calculate inertia from the object's mass since the behavior doesn't give it:

    inertia = mass * (width^2 + height^2)/12

    Also the units of the mass expression of the physics behavior is off.

    so to get a correct value you need to divide it by 50 to get a correct value.

    I forget if there are any other quirks that make it tricky. :/

    I'll try to get a example going over the next few days.

  • [quote:h6zl67ei]Is there a way to set linear or angular damping per object?

    It's not a built-in feature of the chipmunk library but you can do it by either:

    1. setting the velocity to say (velocityX*0.9, velocityY*0.9) where 0.9 is a value from 0 (total damping) to 1 (no damping)

    2. applying a force in the opposite direction as the velocity or angleOfMotion.

    [quote:h6zl67ei]Prevent rotation is another handy feature that's missing

    True. I just need to find a good way to work that in.