dop2000's Forum Posts

  • Arrays in C3 are stored in JSON format. For some reason the editor doesn't recognize that your JSON is an array. Try changing the array size in that popup window, for example increase array depth. Close/re-open the array, maybe it will revert to table form.

  • Nah, maybe someone else will be able to help. I've given two solutions already.

  • Like I said, I can't make sense of your code. Here is my attempt, it's not pretty, but perhaps you will find it useful:

    dropbox.com/scl/fi/u6l027n6mai1oqvikgow9/TextResizing.c3p

  • I'm not sure what's going on in your code.

    If you want to change font size with the sprite size, the easiest solution is to add them to a hierarchy. You can do this temporarily, and remove text from hierarchy after resizing.

    Another option is something like this:

    Text set font size to 18*(Spaceship.width/Spaceship.imageWidth)

  • No, it's an old thing, I remember using these expressions in C2.

  • Perhaps the canvas is on a layer with different parallax or scale rate. You can use new expressions LayerToLayerX and LayerToLayerY to convert mouse coordinates to the layer with canvas coordinates.

    You can use expressions Mouse.X(Canvas.layerNumber) and Mouse.Y(Canvas.layerNumber) to get mouse coordinates for the same layer where your canvas is.

  • Why do you need javascript here?

    If the origin point on the canvas is set at top-left, you can simply subtract Canvas coordinate from mouse position. For example to draw a 10px rectangle:

    Canvas Fill Rectangle Left:(Mouse.x-Canvas.x), Top:(Mouse.y-Canvas.y), Right((Mouse.x-Canvas.x+10), Bottom:(Mouse.y-Canvas.y+10)

    Make sure to set fixed canvas resolution mode.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There should be Project tab on the right, where you can browse the entire project and access all layouts, event sheets, objects, files etc.

  • I suggest creating a hierarchy with a sprite being parent object, and the text being child object. Then when the parent sprite is resized, the text will be resized as well.

  • Does your recommendation hold if each skill has multiple keys associated with it? Base damage, energy cost, etc.?

    Of course. Each skill is still an object which can contain multiple keys or even nested objects and arrays.

    For example:

    {

    "Skills": { "Punch": {"baseDamage":1, "maxDamage":3, "cost": {"mana": 0, "energy": 5}}, "Kick": {....}

    Arrays in JSON may be useful when you need to store lots of similar values. For example an array of coordinates:

    "PatrolPath": [{"x":1, "y":1}, {"x":2, "y":2}, {"x":4, "y":2}, ....]

    So if I parse Ajax.LastData, it remains parsed?

    Yes, once you load data into a JSON object, it stays there of course. And later you can change it, add new keys, delete keys etc.

  • If your game is grid-based, check out the EasyStarJS addon. It's pathfinding for tilemaps. It has lots of features, you can set different costs for different tiles and it can return the total path cost.

  • Perhaps you are missing "Wait for previous action" after AJAX request in event #3.

    If this doesn't help, enable DevTools when exporting, and then check for any errors in console log in the running app.

  • 1. What you want will not work with an array, because you'll have to iterate it every time you need to get Punch or Kick values.

    I suggest you get rid of the array and change your JSON to this:

    {

    "Skills": { "Punch": {"baseDamage":1 }, "Kick": {"baseDamage":2 } }

    }

    This will allow you to access values by direct path like "Skills.Punch.baseDamage"

    2. I have lots of separate JSON objects in my project and load data into them at the beginning of the game with multiple AJAX requests.

    3. There are no built-in ways to sync data between different JSON objects, you will have to do this with code. For example, instead of directly changing damage value in JSON1, make a function "UpdateDamage", which will change it in both JSON1 and JSON2.

  • jobel

    Yes, try "Browser request fullscreen" in the first layout.

    You can install and test Linux games on the Deck without uploading them to Steam. There are several methods. I switch the Deck to desktop mode, transfer the files using Winpinator app, then right-click the executable and select "Add to Steam". It then appears in my Steam library.

  • See my previous comment - Physics is not compatible with other behaviors! Especially if you are using joints.