Speedy1SonicBoy's Recent Forum Activity

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

  • Try Construct 3

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

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

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

  • I should also mention that in the above example, there's also a timer that runs to spawn another molek in (I was hoping) the order of last color and corner, since if Chemic (in black) does not collect Molek in X seconds, and there aren't 4 instances already present that aren't collected, to spawn in another, again in that order.

    That sounds like a function involving a variable to me, but I'm not certain on that, or even how to write it down as one, if at all.

  • The image below shows my code.

    I'm still trying to familiarize myself with the loopindex option and I think that's where the fault may lie in this code.

    This shows where the spawn is planned to be. The four colors indicated by the arrows correspond to the instance colors I wish to have on each corner, which I already have as Sprite2 (Molek) instances. The colors don't actually show because they're randomly generated.

    As well as this, I hope for there to be a path of a quadrifolium until it is collected by the core (in black) to which the previous attachment code is already at play.).

    Each molek can go either clockwise or counterclockwise. This part might be easiest to code for me, since I've had help figuring that part out. However, spawn points as related to color? That's new to me.

  • As a follow up to my attach sprite topic, but this time with spawn of sprite2 instances. I'd hope for the same color to spawn from the same spot such that yellow spawns from top left, blue from top right, pink from bottom right, and green from bottom left in that order, but I'm currently having trouble setting up the rotational order of sprite2 to spawn in time. Instead all sprite2 instances spawn in the same top left corner...

    I can provide examples of my code in screenshot form when asked.

Speedy1SonicBoy's avatar

Speedy1SonicBoy

Member since 28 Sep, 2024

None one is following Speedy1SonicBoy yet!

Trophy Case

  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

3/44
How to earn trophies