Speedy1SonicBoy's Recent Forum Activity

  • I've gotten closer to what I want now but it's not 100% just yet.

    Below is an example of my code:

    And this is what's happening:

    The Sprite 2 is now just a little too close to/far from Sprite 1 anchor to make a stable shape, and the other instances sometimes overlap. Also, upon Space being pressed ALL instances have the bullet reaction instead of just the one connected.

    Still, I consider the appearance of anchors on Sprite 2 a success over not having them before.

    I think I'm missing the 0/1 variables for those, but tell me, is there something else on top of that I might also be lacking?

  • So those are the images of the instance shapes. However, to reject with the space button...

    ...In the order in which it's collected, the Sprite 2 instances (Colored) will be thrown in the angle from which it is collected by Sprite 1 (in Black). This is so that the shape made can match with the plans shown above.

  • 28 total instances of Sprite 2 can be attached at once. So... the shape can get pretty big lol

    The before attach is as the first Construct image, and the after is something like the second. where I'd like for it to be able to attach is given by the orange dots of the next examples here:

    Anywhere along those orange dots, I'd like for instances of Sprite 2 to be able to attach to, such that they're diagonal from one another.

    As for the instance variables, I like that idea. Will keep you posted on whether it works or not, though, for some reason, it tends to require a reset lol.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

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

Speedy1SonicBoy's avatar

Speedy1SonicBoy

Member since 28 Sep, 2024

None one is following Speedy1SonicBoy yet!

Trophy Case

  • RTFM Read the fabulous manual
  • Email Verified

Progress

2/44
How to earn trophies