Speedy1SonicBoy's Forum Posts

  • Screenshots will be better, I think.

    What I have is basically like a top-down POV of the picture above, but the green one on the top right hovers with the rest of the form, and no other instances will collect.

    So Sprite 1 attaches to Sprite 2 at the anchor points like I wanted.

    What I want is for each Sprite 2 that's attached to then have anchors to attach to other Sprite 2s, but only when attached to Sprite 1. I'm thinking heirarchy and having children of Sprite 1 be Sprite 2 might solve the problem of in which order, but when I press Space I also want the Sprite 2s to shoot out and remake-available the anchors once present.

    The code so far is as follows:

    But I think I messed up towards the end with the Sprite2Anchors somehow. Is there any way I can keep the other ones attachable as well, such that the attached Sprite 2s can keep their positions?

  • I just realized that the YouTube link isn't working for me for some reason.

    Anyway, maybe this can help illustrate what I mean.

  • My idea has gone bust. Though the initial plan worked, the added complication, well... complicated things.

    I want to know how to add additional instances on anchor points of Sprite 2 attached to Sprite 1 without it jumping all over the place in confusion with itself.

    I don't know how else to explain it, other than that the resulting shape should be bigger. There's also the added idea of pressing space to immediately get rid of the sprite 2 that was just collected, making the overall shape one less than it was. That part I'm almost certain I have down, but angles are weird, too. I hope to reject the piece and it to bullet to the direction from whence it came. That seems like its own post, honestly, but do let me know.

  • Please post a screenshot of your code or the project file.

    Actually, *whew...* I got it to work! Thanks so much!

    Now the idea might just be to create more anchors for the Sprite 2s that are connected to Sprite 1, again such that they don't overlap. Thankfully, I think I might just know how to do this thanks to you!

  • Alternatively, if you want to do this with image points, you will have to loop through all image points, check which ones are unoccupied, and which one is the nearest to Sprite1 - the code for this will be pretty complicated.

    Based on my example off of what you said, I think the latter may be the best and more thorough option. I think it gives room for the second part to this as well, which you already gave me the idea on how to solve for with the former example.

    In any case, I must have done something wrong, because some weirdness is going on where the other instances aren't occupying any other anchors.

  • > Yes, your event may look something like this:

    >

    >

    >

    >

    > Origin image point has index 0. Image points 1-4 are for attaching instances of Sprite2.

    Nice!

    First point seems to work. But now having done this in an example project, all instances of Sprite 2 seem to point to the same point.

    Not what I was hoping for... Proximity to the points was the thing I was hoping to attract Sprite 2 to Sprite 1, so that by proxy each one would attach to each point. Could it be because I have all my versions of Sprite 2 in the same family and am referencing the family instead? Or is there something more?

    Maybe I'm complicating things a little lol

    My idea was to have an instance of Sprite 2 attach to whichever of the 4 points Sprite 1 has nearest it without the other instances of Sprite 2 taking its place. Mind you, I also have the instances of Sprite 2 in a family, and I think I made it harder for myself in doing that, but I'm yet not sure.

  • Yes, your event may look something like this:

    Origin image point has index 0. Image points 1-4 are for attaching instances of Sprite2.

    Nice!

    First point seems to work. But now having done this in an example project, all instances of Sprite 2 seem to point to the same point.

    Not what I was hoping for... Proximity to the points was the thing I was hoping to attract Sprite 2 to Sprite 1, so that by proxy each one would attach to each point. Could it be because I have all my versions of Sprite 2 in the same family and am referencing the family instead? Or is there something more?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are a few options:

    1. Create an instance variable - AttachmentPoint=1. Use it to identify which image point to attach Sprite2 to, and increment it by +1

    2. If attaching with hierarchy you can simply check the number of children on the parent sprite.

    3. You can loop through all 4 image points and check if any of them is not overlapping Sprite2. Use "System Is overlapping point" condition.

    Right, I should have said this before: I've just started dabbling in Construct, but I think Number 1 seems simple... I feel like I might be missing some context: how do you identify the points with an instance variable? Is that where the Event Sheet comes into play?

  • So I have a player sprite that has four additional points as well of the origin point. I want it to collect the other sprites in any of the four points (but not the origin) while also not having them overlap once that point has been taken. Any tips? Would be greatly appreciated!

  • For a family of sprites I want them all to follow what is essentially a quadrifolium path (some nestled also within another quadrifolium path, tilted 45deg)

    Coming from a beginner in Construct, trying to figure out how to apply the math has been a massive headache for me. Any suggestions would be highly appreciated!

    Tagged: