oosyrag's Forum Posts

  • lerp(player.x, player.x-200, 0.5) is the equivilant of moving the player left 100 pixels every time it is run.

    Since player.x gets updated every time it is moved, lerp isn't doing much here.

    Example if you have running every tick

    Frame 1. Player.x is 2000. lerp(player.x, player.x-200, 0.5) = lerp(2000, 1800, 0.5) = 1900

    Frame 2. Player.x is 1900. lerp(player.x, player.x-200, 0.5) = lerp(1900, 1700, 0.5) = 1800

    Frame 3. Player.x is 1800. lerp(player.x, player.x-200, 0.5) = lerp(1800, 1600, 0.5) = 1700

    and so on.

    If you want a gradual movement that slows down, use a fixed target (usually accomplished by setting the target position in a variable once). So set TargetPosition to player.x-200, one time. Following the previous example on frame 1, this would be 1800.

    Frame 1. Player.x is 2000. lerp(player.x, TargetPosition, 0.5) = lerp(2000, 1800, 0.5) = 1900

    Frame 2. Player.x is 1900. lerp(player.x, TargetPosition, 0.5) = lerp(1900, 1800, 0.5) = 1850

    Frame 3. Player.x is 1850. lerp(player.x, TargetPosition, 0.5) = lerp(1850, 1800, 0.5) = 1825

    and so on. You can see the amount the player moves each tick gets less and less, but it will never actually reach 1800.

    If your lerp event runs only once, it also doesn't serve much purpose in this case.

  • If you made an isolated example that showcases your problem that would be a good place to start.

  • That's why you're making a tutorial for it isn't it?

  • "Using the sine behavior to create nifty animations"

  • For advanced sorting of arrays (and shuffling), you generally want to use a second placeholder array. Push your values in the desired order to the second array, delete the index of the original values in the first array, and then optionally copy all the sorted values back to the original array.

  • Sorry it was actually "trigger once while true", not run once while true. You can find it in system conditions.

  • Bullets do not get "blocked" by solids... but you can set them to bounce off solids.

    It doesn't matter what other behaviors you are using, as in this case bullet would be the one taking care of the movement, and it doesn't care that there is a solid in the way. For example, even if I was using 8 direction, if another event decided to move me into the middle of a solid I would still get stuck in it.

    Although..... how do you define blocked? Do you want it to just stop? Or slide along the edge? Stopping is simple, just set bullet speed to 0 upon collision.

  • Ok this was pretty simple. The height of your worm's collision box isn't the height of the entire sprite. It is only the bottom 42 pixels of the sprite... which gives you the 41 number when the bottom of the player sprite starts to overlap the worm's collision box.

  • Checking it out, but first I think I should mention each group takes up an event towards your free edition limitation - you might want to use comments to organize instead. Groups are generally most useful for toggling sets of events active and inactive, so if you're not doing that they don't really serve much purpose.

  • Option 1 - System save and load actions - https://www.scirra.com/tutorials/526/ho ... -savegames

    Option 2 - Localstorage - An entire array or dictionary object holding values you wish to save can be written to a single localstorage key as JSON. That key can be checked on start of layout to see if it exists.

  • Need more details. Or a capx.

  • The entire event sheet will run once per tick. If the conditions are true, those actions will run.

    The exception are triggers (green arrows) which only run once when triggered. You can turn an event into a trigger by adding the "run once while true"condition.

    Edit: here are two very useful articles you may not have found.

    https://www.scirra.com/manual/75/how-events-work

    https://www.scirra.com/blog/141/common- ... nd-gotchas

  • You can set up a time server with the multiplayer plugin. Connect to an always on host, which sends the servers Unix time.

  • How do you have his movement set up to begin with?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why not just allow the user to choose the first time they run your program? You can save the preference to localstorage so it doesn't ask again next time.