foolberry's Recent Forum Activity

  • Sort of tried this. Problem is that all other physics objects can also collide with those objects - hence they become not useful.

  • justifun This I have tried. And the results are erratic. Seems to work well if the object is not colliding with anything. But if it's touching anything then it slows it down as if it had a massive coefficient of friction. Tried various workarounds - upshot is - it didn't work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The gravity direction doesn't help much. You can fake that by switching off gravity and applying the force yourself. But still other objects can knock it off the axis you want to constrain it to.

  • Sure. There are lots of possible examples.

    Scales - where the more weight you put on an object caused it to move down.

    Pistons - moving up and down under physics - but never moving to the left or right.

  • It did seem a little clunky.

    In an ideal world we'd be able to pass an object into a function (as if using a pointer). Not sure how that would work with C2's architecture. (I guess NOT)

  • Looks like that is how it works.

  • How does the picking work with functions? If I've picked an instance and then call a function which refers to that type, will it use the picked type?

    I'll give it a go and find out I guess.

  • Is there a way to do this? Say that I want an object to have physics in along the x-axis, but always have the same y-axis position - as if it were running on a rail.

    I can't find a way - and hacking it through setting Y every frame has nasty results.

  • Good news. Thanks for digging that one out.

  • I forget the exact formula I used, but I did something like:

    volume = -(distance(object.x,object.y,player.x,player.y) * somefactor)

    If somefactor is higher, the sound will fade out 'faster'.

    This is the exact formula I use as well. However note that the distance is in pixels so if somefactor == 1 then the sound will fade out very quickly. A good value of somefactor is 0.01

    For readability I write it as a divide...

    volume = -(distance(object.x,object.y,player.x,player.y) / somefactor)

    With somefactor = 100

  • People don't have time to make tutorials with pictures for every question that people have, unfortunately. You are going to have to work some elements out yourself.

    You want to make a jump where the height jumped is dependent on how long you have been holding the key down.

    This is done in two stages.

    Stage 1: find out how long the player has been holding the button down.

    Stage 2: Use that to determine how high the jump should be.

    So that sounds easier now. To do stage 1, you need to use the System.time expression when the key is pressed - store it in a variable. When the key is released you can use the System.time expression again to get the new time, subtract the old time (which you stored in a variable) to get the length of time the key was held.

    To do stage 2 depends on how you are doing a jump. Are you using the platform behaviour for example. Anyway - hopefully you will know how to make a jump. All you have to do is use set the value of the jump height using the value you obtained, probably with a multiplier, probably also clamped to sensible values.

    Hope this helps.

  • Dammit - ramones got there first.

foolberry's avatar

foolberry

Member since 4 Aug, 2012

None one is following foolberry yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies