R0J0hound's Forum Posts

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

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

  • Use instance variables for filtering. With it you can disable collisions of other layers and such. The stairs by far will be the trickiest to do. Well, other than implementing path finding and line of sight, you'll have to get creative for those.

    Here's an attempt at stairs you can go up and down. There's likely an easier and cleaner way but it escapes me at the moment.

  • global number t=0

    every tick:

    --- set t to abs(time%2-1)

    --- set x to cubic(a.x, a.x, b.x, b.x, t)

    --- set y to cubic(a.y, a.y-100, b.y-100, b.y, t)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use the Snapshot action instead. For for a 100x100 image centered on position 50x50 you could do this:

    ---Set canvas size to 100x100

    ---scroll to (50, 50)

    ---Take Snapshot

    on snapshot

    ---set canvas size to 640x480

    ---scroll to (320,240)

    ---invoke download of canvasScreenshot

    The second scroll to is to scroll back to the original scroll location. If the layout isn't using unbounded scrolling you could also use (0,0).

  • This example may help:

    Z is just the y distance from the shadow on the ground.