Sup with that?'s Forum Posts

  • In my experience you may need to dumb it down as much as possible for mobile, yes.

    But like, why not test it on a phone first to see if it's a problem before cutting it?

  • I was thinking a simple proximity check like "Bot distance to player greater than X --> destroy Bot", in which X can correspond roughly to the size of the viewport so that when the camera gets closer/further they're spawned or destroyed. Might not work as well if zones vary in size though, because if a zone is several screen lengths across a bot on one end would not spawn until the player moved closer, despite being in the same zone.

    LOS can be a way to do it as well I guess, just separate the zones with objects designated as LOS obstacles. That way bots in one zone won't be able to see the player when he's in another zone.

  • If you're using some hidden object to control the scrolling of the screen, maybe you can link the bot spawns to the proximity of the object. Sort of like,

    If Bot is not within [Viewport distance] of Scroll Thing --> Destroy Bot

    If Spawn Point is within [Viewport distance] of Scroll Thing --> Spawn bots/Recreate bots

    This way the bots would be destroyed when the object pans away to another zone, and spawned and/or recreated when it come back.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is a behavior called Flash which you can use to make the blinking effect, and there are some WebGL effects you can add to the object that change color, you'd just have to enable/disable them through events as needed.

  • That... works for the most part! Only issue seems to be having multiple locomotives, which results in the first car of one train turning to face the last car of another one since they're instances of the same object. However, it seems I was able to get around it by assigning custom IDs and Pinning by position & angle in this case.

    Anyway, works lovely now, big thanks!

  • Preferably without using the For Each loop. Maybe I'm missing an obvious solution so I'm taking a step back here.

    Think of a train with several cars attached to the locomotive. Each car is Pinned to the one before it, and each tries to rotate towards the position of the one it's pinned to for a natural, flowing effect. Now, I was able to do it easily enough using a For Each loop, but, this results in a pretty severe fps drop when there are a lot of cars and trains. Not having a For Each loop in the event apparently makes it not work altogether. So, is there a way to do this without a For Each loop?

    Thanks for any help.

  • Just to make sure, if you're worried about performance impact from using too many layers, don't be. Number of layers shouldn't affect performance. In fact, moving all the objects through events rather than letting them sit still on their own layer would probably be less efficient.

    That said, depending on what you're using to move the character, you can possibly use the character's movement speed and angle of motion to nudge objects in the opposite direction at different rates. E.g. something like,

    Character is moving

    --> move Object A [Character.Speed/2] at angle [Character.Angle+180]

    --> move Object B [Character.Speed/4] at angle [Character.Angle+180]

    This means Object B will travel at half the speed of Object A in the opposite direction that the character is moving, thus making a sort of parallax effect.

    You can also have a look here at Somebody's effects, namely the Seamless and Scroll effects. They can be used to achieve similar things, albeit per object.

  • That sounds like it'd work, I'll try it out and report back if I get any problems. Thanks!

  • Thanks for the advice guys, I had varying degrees of success but it seems the more complex the project got the more trouble I was having with the loops. Right now I've got a kinda ghetto setup where each sprite spawns a "breadcrumb" after an action, so that the next sprite in line moves over it, does the same action and spawns another crumb for the next sprite, etc. Surprisingly it's giving the best results (visually) out of all my other attempts, even if it's kinda inelegant. Oh well, I'll see what I can do.

  • If it's even possible. Or, how can I insert a delay within a For Each loop that works for each object?

    The premise: I have several sprites moving in a chain, the logic for which is basically the same as in the default Pin Chain Style example. I want to make it so the leader sprite shoots, then after a short delay the 2nd sprite in line shoots, then the 3rd, then the 4th, etc. thus creating a sort of "stuttering" volley of shots. I've been trying to make this happen by making the sprites spread a value (a "shoot" signal) amongst themselves using a For Each loop, starting from the leader and working down the line, but I can't seem to figure out how to delay said value's spread. Right now all the sprites effectively shoot at the same time because the value spreads instantly.

    I tried using the Wait function but this doesn't seem to repeat itself within the loop. Instead it waits X number of seconds at the very start, then runs the loop continuously without ever Waiting again. I was hoping it would repeat the Wait on every pass, so that each object had to wait a while before shooting. How can I do this (with or without the Wait function)?

    I mean, maybe I'm coming at this from the wrong angle, so if anybody has a better solution I'm all ears.

    Thanks for any help.

  • Might be simpler to just use the Persist behavior to make sure the stars don't respawn when you change layouts. That way you can just add 1 to your variable every time you collect a star, since you won't be able to recollect them.

  • Are you using the Pin behavior? Pinning it by Position & Angle should move it on both the X and Y axes automatically.

  • Objects have the expression "Count" which counts up the number of existing objects of this type, so you can use that. Something like,

    Start of layout --> Set score to Stars.Count

  • Yeah just use it the same way as your current jump control.

    On any touch end --> Player simulate jump

  • Perhaps you can use the "On any touch end" condition to do this.