dop2000's Forum Posts

  • You need to learn a bit about how things work, in order to understand what you need. Read about instances, instance variables, families, containers.

    Study the game templates that are included with Construct - Kiwi Story, Pop Lab etc. They demonstrate the best programming practices.

  • The problem must be with some other event - maybe you are resetting ShakeTheGround boolean, or deactivating the group. Like I said, if you add console log to events key events, you should be able to figure it out.

    I tested and this works fine:

    .

  • Tween value becomes 0 when the tween ends. So you need to add "Tween is running" condition to that 3rd event.

  • I think it's a combination of two things. First of all, you definitely shouldn't use int() here, as this will stop the object about 20px early.

    Another issue is Physics. It's not recommended to move Physics objects with non-physics actions. What happens is - Physics behavior is "resisting" and adjusts platform position, moving it a fraction of a pixel back. For example, if lerp set platform at Y=500, Physics moves it to Y=499.99995. Then you use int(self.y) and CurrentPosition value becomes 499. As a result, your platform can not move further.

    If you remove int() and disable Physics, then your code will work correctly.

    .

    I suggest using LiteTween. You can achieve the same effect and it will stop at the exact position (unlike lerp, which gets infinitely close, but never actually stops). And then when the tween is finished, you can enable Physics.

  • Are these different objects, or one object with 24 instances?

    Use System -> Pick random.

    If different objects, add them to a family, use Pick random ObjectsFamily.

  • Add this action to the third event on your screenshot:

    Browser Log GreenGroundShake.ShakeTheGroundScale & " : " & LayerScale("Player")

    Open browser console and you should be able to see the value of ShakeTheGroundScale and the actual layer scale. Maybe this will give you an idea what's wrong.

  • I believe I understand the question. See this demo, there are two methods you can use, I prefer the second one:

    dropbox.com/s/4l59w2ja04drzck/ContainersAndFamilies.c3p

  • This is what I found in google:

    metamodpro.com/browser-language-codes

    Also, you only need the first two letters of the language code. For example:

    left(Browser.Language,2) = "fr"

  • You need to decide if all these sprites will be separate objects, or if it can be a single sprite object with multiple animations/frames.

    If you need to spawn many different objects without duplicates, you can name them like Obj1,Obj2,Obj3... and use "System Create by name" action:

    Repeat 20 times
     : Create by name "Obj"&loopindex at (random(1920), random(1080))
    

    If this will be a single sprite - create this sprite, and then set a frame.

    Repeat 20 times
     : Create Sprite at (random(1920), random(1080))
     : Set Spirte animation frame to loopindex
    

    Instead of random position you can use invisible "spawner" sprites - then when creating a new object, pick a random unoccupied spawner.

    jjc001 Creating a family instance will pick a random family member, but this method may produce duplicates. And OP said he needs each sprite to be created only once.

  • Yeah, so basically rays are cast at angles +1,-2,+3,-4...-60, or -1,+2,-3,+4...+60. This is to decrease the number of collision checks and to randomize turn direction. I don't know if you've noticed, but I also decreased LOS angle, otherwise all boids would form a single flock after a few seconds.

    As for the movement, I think Bullet is pretty lightweight. If you move boids with events, I doubt there will be much improvement in performance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • how could I get it to be put to all the texts of the project?

    You can add all text objects into a family. And then do "TextFamily On Created -> TextFamily set web font"

  • Then why are you posting in Construct 3 forum?

    construct.net/en/tutorials/how-to-use-a-web-font-in-construct-2-1334

  • I played a little with your project, check it out:

    dropbox.com/s/zansxeb6jmx3lea/TestBoids_2.c3p

    Not sure if this works better or worse, but maybe you can use some of my ideas.