dop2000's Forum Posts

    • Post link icon

    Beta7 So you are saying you found a much better solution. Show it to us please.

  • Did you see the official multiplayer examples?

    There are also tutorials:

    construct.net/en/tutorials/search

  • Yeah, you are right, something weird is going on.

  • I tried your project and can't reproduce this bug.

    Check the spritefont object in debug mode when it's blank - see if it has correct size, scale, opacity settings and if it contains any text. Also see if there are any error messages in browser console.

    • Post link icon

    Sorting without array

    This example uses instance variables, which I was suggesting from the beginning. OP wanted to sort global variables.

  • See "collision checks" in the debugger. Over 1000 checks/tick could cause performance problems.

    Also check the CPU Profiler tab to see which events are using CPU the most.

    And of course there are too many objects. If many of them have enabled behaviors (like Bullet, Sine etc.), this is also very bad for performance.

  • You need to parse AJAX response into JSON object. Then you will be able to extract keys from JSON using JSON.get expression. For example, JSON.get("0.class") should return "warrior"

    See the official JSON example in Construct.

    editor.construct.net

    Also here is a tool I made that shows paths to all elements in JSON:

    dropbox.com/scl/fi/3lvdqp1x1v57xy0prahrj/JSON-RecursiveRead.c3p

    • Post link icon

    I already found another method waaayy apart from what you were telling me before I found the perfect code to sort any car rank points in my game

    Please enlighten us about your method of sorting scores in global variables. Even for experienced developers it's never too late to learn!

  • "On click" is a trigger, it can't be inverted. You can use two conditions:

    Mouse Cursor over object + Mouse left button is down -> Set frame 1

    Else -> Set frame 2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use replace() expression.

    Set text to replace(string, "Martha", "[color=#ff0000]Martha[/color]")

  • If you don't want to use an array or JSON, you can use a bunch of variables.

    You will have to add events for crafting each item. For example, to craft a table, first check if wood>=4, subtract 4 from wood variable, add 1 to table variable.

    But with more items this system will quickly become unmanageable. I strongly suggest learning arrays or JSON.

  • You do not have permission to view this post

  • Well, I don't know your game. I assume there is a tilemap? Like I said, these are two different approaches:

    1. Create invisible sprites on frozen tiles with the required physics properties.

    2. On every tick compare the tile under the character. If it's frozen - temporarily change the properties of the tilemap or behavior. We do this in our game - when walking on ice tiles, 8direction deceleration is reduced, so the character is sliding.

  • You are using wait inside the function. The parent event where you call the function won't wait for it to finish. That's why it displays "???"

    If you need to wait for the function to complete, it needs to be set as asynchronous. And asynchronous functions can't return a value.

    You can do this:

  • There is no easy solution. You can spawn invisible sprites on top of frozen tiles with different physics parameters. Or you can check which tile the character is overlapping and change physics setting in real time depending on tile type.