Speedy1SonicBoy's Forum Posts

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

  • You do not have permission to view this post

  • You can use Timer behavior. Or increase a variable every 1 second, and check if it's >=5 seconds.

    For this... I might also need another example.

  • Say, you have a single Enemy sprite with animations Zombie, Skeleton and Goblin.

    Put 3 copies of this sprite on Assets layout. Configure the animation and instance variables like HP, armor etc. And give a name to each template:

    When you create an Enemy from "goblin" template, it will be created with the correct animation and variable values.

    Templates are not related in any way to animations. You can have multiple templates with the same animation, for example "zombie_soldier", "zombie_medic"

    I think I have it now.

    Thanks for the example, it really cleared things up. Now how do I trigger a spawning to a certain event OR a timeframe, say, of 5 sec of that event not happening?

  • I think you understood correctly. However, I myself am having trouble with understanding some of the context here. How can I implement templates in animations? Do I name the template the same as the animation?

  • I have four different animations for a sprite. I had an idea to attach a variable number for each animation of an object to affect where they spawn in. Perhaps I'm looking at it the wrong way? Perhaps there's something else I can do instead?

  • This was made before you posted your last few posts but maybe you can get some ideas from it.

    Roughly it just creates attachment points around all the attached objects, and then deletes invalid points that overlap other attached objects.

    It keeps track of what's attached with a boolean variable and doesn't let moving objects get attached so you can throw them. Also it keeps track of the order the objects are added with a number variable.

    https://www.dropbox.com/scl/fi/7vf4eia7vzvmnzd8hoi6g/dynamic_attaching.capx?rlkey=gjl65ke9vjpj0nqsz42im1fq5&st=niaagaur

    Well, that's huge, to say the least. Thank you! I'll take a look into it and see what I can reverse engineer!

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

  • Try Construct 3

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

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