Nimble005's Forum Posts

  • 7 posts
  • So, as I understand it, a distance joint acts as a "pole" between two objects, allowing neither to move any further or closer then the distance between the two objects at the creation of the joint.

    I am trying to get only a piece of this functionality. I am creating a fishing game, and I have a hook that I want to attach to a bobber. What I want is a rope, not a pole. The hook can get closer to the bobber, but not farther away.

    Is there a way to do this?

    Thanks

  • So I have two points. One is the origin I launch my "Bobber" Physics object. The other is where I clicked my mouse. The angle at which I launch the Bobber is constant. I need to calculate the force needed to launch the Bobber and have it hit the point where I clicked the mouse.

    Has anyone done this already, or could someone point me in the right direction?

    Thanks

  • Great! Thank you, I learn the best from examples, so this is very helpful.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you click the recast button, this is where you need the "For each" loop, or a "Pick all fish" condition.

    Edited .capx: Nimble_Fishproblem.capx (r97)

    Ah, that makes sense, thank you much for taking a look. When you run it, do the "Fish" constantly move around their origin? I was trying to get them to stop moving once they reached their origin.

  • Hmm, do you think you could share your .capx through dropbox so we can have a look at the problem?

    It makes everything so much easier when we can see what happens and fiddle with it.

    Sure thing.

    dl.dropbox.com/u/88631007/MyProj.capx

  • Try adding a "For each (fish)" condition in there. It's a system condition

    EDIT:

    I think I tried that before and it didn't help. Here is what I've got now:

    <img src="http://s16.postimage.org/dv8l5550z/Event2.png" border="0" />

    Now the fish move to the hook, but when the hook gets destroyed by a recast, they just sit there.

    EDIT: Alright, I saw the problem, I inverted that distance check when I shouldn't have. When I fixed that, their behavior is the opposite. The Fish now constantly try and get to their origin, even if they do get there, unless they are going after a Hook.

    Also, if you want your fish to stop when within 10 pixels of it's origin, instead of the 4 conditions, you can do it with only 1 if you use the distance expression.

    Use "System: Compare two values", then input:

    distance(Fish.X, FishOriginX, Fish.Y, FishOriginY) < 10

    Ah, thanks! Much cleaner.

  • Greetings!

    Just started working with Construct2, and I am loving it.

    I have sprite called "Fish".

    When I cast my "Hook", I pick a random instance of a fish (I have 5 at once) to go towards the hook at eat it. I also have an ability to "Recast", which destroys the hook.

    What I want, is for that Fish to go back to it's original position, and I have that part already figured out; I grab their starting position in an instance variable when they are created, so they know where to go.

    This is my event to tell if the fish is home or not:

    <img src="http://s7.postimage.org/64d6pnlmx/Event.png" border="0" />

    My problem is, the engine seems to only set this once all the fish meet those conditions. I want to set it on a per-Fish basis. If one fish meet these conditions, set "AtHome" = true for that fish.

    I've looked in the "How do I" page at the instance-specific guides, and I didn't see one that addressed this.

    Thanks!

  • 7 posts