Speedy1SonicBoy's Forum Posts

  • That's it! Works like a charm, thank you!

  • This seems to work perfectly, given the 5 second count.

    One more thing:

    So when the last molek is attached, I would hope for another to spawn. In other words, I suspect there to be an "OR" block used somewhere in the 5 second block but can't seem to figure out how to get it to spawn only once per attach.

    If 5 seconds have passed and the molek isn't attached, then another may spawn, but only up to 4 at a time.

  • I see you've put an example, which is helpful.

    I should have specified, however, some of the parameters I planned to have in place.

    So when the last instance of Molek is attached, or after a certain amount of time passed, I hoped to spawn another in the designated place, all dependent on what color the last one was and where it spawned, which, due to instance variables, are supposed to be one and the same.

    I say "supposed to be," because sometimes a Molek will spawn in the center of the stage, which isn't what I intended. How should I go about fixing that? And for the time factor?

    Thanks in advance!

  • The initial question was partially solved. However, one thing still remains:

    I'm trying to spawn the object instances in clockwise order with 1 being first, 2 second, so on and so forth. What I have for code so far is this:

    I know the second line is a repeat of the first, and is wrong, because after the first color shows, only the second color in line shows up afterwards, and what I would want is for all colors to show in sequence, regardless of the last one that shows/is attached to the main sprite (Chemic). What I had before was a "choose(1,2,3,4)," which wasn't what I was looking for, either.

    Any help, as always, is appreciated.

  • As the title suggests, how do I tween the speed of an animation to slow down over time? The idea is for said animation to slow down over a period of 10 sec, from 100% speed (60fps) to 0% upon an event happening. That is to say, it should be triggerable.

    Any help is, as ever, appreciated.

  • I found out a way to do it. Seems a bit primitive and needs work, but it works. Essentially, the code I have has a sparse dictionary that pinpoints the marker sprites' location relative to the main sprite. So I check that sparse has certain keys for those locations, along with a set number of attached sprites, to figure out whether the shape is built or not. A prerequisite number of attached moleks, with the markers in the right spot, should trigger the shape variable as true.

    Like I said, this may need refining, as I figured out that the child_count leads to imperfections in the number of moleks needed to find the shape. However, trying to identify the first child_count as =4 seems to not work for some reason, so I've left it as >3 for now.

    I've also figured out how the other shapes as well, they have different sparse keys and child_count number requirements.

  • Indeed... I have a marker sprite I use in-game to attach the main sprite (in black) to the others. Perhaps by counting the instances of the marker sprites I can confirm the shape? I noticed that each shape has its own corresponding marker number. Going back to the example, that the first shape has 8, the second has 16, and the third has 12.

    Perhaps by storing this marker info as well as the number of attached sprites to match it maybe I can confirm the shape that way?

  • As part of my being able to attach sprite instances a certain way, which is solved.

    construct.net/en/forum/construct-3/how-do-i-8/attach-sprite-specific-way-183986

    This, however, is just the beginning. With being able to attach the sprites the way I have, certain shapes can be built with them. I was thinking of making an instance boolean with the instruction, "is Shape built?" to check that a certain shape build with the moleks matches the diagrams shown below, but to actually have the game check if the shape is already built with sprite instances or not seems like a daunting task to me.

    What it would be like, then, is the shape that is built advances the player to the next stage, which asks to build a shape over the one already built. For example, from this:

    To this:

    To this:

    Three stages per world.

    I have the Levels Manager plugin in anticipation to this type of build, so if anyone has any experience with it, that would be extremely helpful.

  • Have you tried not using a behavior and moving the object directly with the polar equation r=a*cos(2*theta)?

    Something like:

    Var theta=0

    Var rot=0

    Every tick

    — sprite: set position to 320,240

    — add 30*dt to theta

    — sprite: move 200*cos(2*theta) pixels at angle theta+rot

    That will move it along the path and it starts on a leaf. You can rotate the whole path with the rot variable.

    You can also change the angle of the sprite to be at the angle its moving by saving the old position before moving and setting the angle to angle(prevX,prevY,x,y) after you move it.

    I might be missing something... the sprite is not behaving the way this is intending. I think it may be because I haven't gotten rid of the bullet behavior yet. But it's hard to tell.

    I can provide my code upon request.

  • See, I had a feeling I was trying it the wrong way.

    What I tried to do was add a certain amount (let's keep it at 100 deg for example) to a formula already existing so that it could alter the angle.

    What I'm trying to do is a quadrifolium path with the sprite already spawning at one of its arms (the far ends of the four-leaf clover shape.) I'm also not trying to make the sprite look like it's rotating while it does so.

    Hence, I chose the bullet instead of rotate behavior.

  • The object in question uses a bullet behavior. I'm wondering if there is a way to code the angle of motion such that the ensuing angle continually adds/subtracts to make the object rotate. An attempt to do this on my end was... unsuccessful.

    Any help, as ever, is appreciated.

  • I've got it!

    So the numbers might help clear things up.

    In numerical order, with the colors intact, this is basically the order in which I would want the moleks to spawn.

    In other words, clockwise spawn rotation, if that makes sense. The colors would still show depending on the corner, but first yellow, then blue, then pink, then green.

    Your above example has them spawn in randomly, however the colors remain which I can't seem to find a way to get to spawn in order...

    I know it's been a while since I started this post, but if you're still there I really appreciate it!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To be honest, it's difficult to understand your task. It would help if you could attach a picture or a demo project.

    You can run a value tween with "In Sinusoidal" ease and Ping-pong=yes settings. And add the value of this tween to the object's motion (speed or orbit angle).

    https://www.dropbox.com/scl/fi/unabdyo98ot8jac68hs5d/Orbit-Tween.c3p?rlkey=lpgsytl2icvrtcah9a3umnb8p&st=u0j47zgt&dl=0

    The example above has been extremely helpful.

    However, I think what I'm trying to say is that the orbit behavior seems to override all other behaviors in terms of movement. I was hoping for the orbit to influence the overall movement of the object but not override the overall movement.

  • To sum up, there's an orbit that takes place in only part of the animation. I'm looking to speed it up and then slow it down at equidistant time. (a 2-second frame where the orbit speeds up in 1 sec then slows down in 1 sec) I'd also like for the orbit to not overtake any other motion the object may have such that the object can adjust in all other aspects of motion (x, y, angle, etc., etc.). Don't know if my question is understood, but any help will be appreciated, as always!

  • The code is quite a mess to be honest. You need to understand how picking works in Construct!

    Once you create/spawn a new Molek instance, it gets automatically picked in all the further actions and sub-events. I outlined all these lines with red - they apply to the created instance only:

    So the sub-event #27 will compare the color value of the newly created instance only, not any of the other existing instances! Which means "Or pick Molek instance 2" condition is moot, because the picked scope only contains 1 instance.

    If you want to compare other instances in a sub-event, you need to use "Pick all" condition first. But then you will need to pick the newly created instance again to change its color variable.

    Can you explain what these particular events 26-27 are supposed to do? And then I may be able to tell you how to fix them.

    I thought it might have been messy lol

    I tried to make a check of color Molek already spawned before, so that the other color of order would show. For instance, if spawned blue, then pink would show next, or if spawned yellow, then blue, and for each corner to correspond to the color (a part I may have neglected, in retrospect).