dop2000's Forum Posts

  • You are using a wrong loop. Instead of "System -> For each dictionary" you need "Dictionary -> For each key"

    Inside the loop you can use Dictionary.CurrentKey and Dictionary.CurrentValue

    .

    Another option is to use "System Repeat Dictionary.keyCount" loop.

  • You can switch the sprite to another (empty) frame or animation.

    Or use this to clear the image:

    SnapshotSprite: Load image from "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=" (Keep current size, cross-origin anonymous)
    
    
    
  • Do you want just to position them in a circle, or should they move/rotate around the center of the circle?

    To position you can use a loop, for example for 16 sprites:

    Repeat 16 times:
     Create Sprite at (centerX, centerY)
     Sprite move 100px at angle loopindex*(360/16)
    
  • Isn't it better to use worker mode for performance?

    Yes it is. With the worker disabled in our project, there is now a significant lag before graphics is loaded for every object. You create a sprite and it appears a full second later...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm assuming you are making a platformer? There are hundreds of free examples in Construct, for beginners and advanced developers. You can open and study any of them, or even use them as a template for your own game.

  • For some reason it never occurred to me that I could create multiple instances of objects that don't have a location on screen.

    Yeah, it's a forbidden knowledge haha

    It's also possible to add an array to a container with other objects. For example, if you add StatsArray and Enemy sprite to a container, then each enemy instance will have its own instance of StatsArray.

  • You don't need CSV, you can simply copy-paste data from Excel directly into C3 array editor. Just create an array with enough empty cells and press Ctrl-V

    You can make 2D and even 3D arrays. For example, in our game we have ShopsStock array with multiple sheets. Each sheet is a different shop. On Y axis there are items, on X axis - properties like item cost, materials etc.

    Check out this comment:

    construct.net/en/forum/construct-3/how-do-i-8/trying-plan-code-game-start-179514

    I also suggest learning JSON, it can make your task much easier. I actually prefer using JSON now where possible.

  • You need to disable the worker in project properties. It's an NWjs bug, see comments in this post:

    github.com/nwjs/nw.js/issues/8075

    I really hope they fix this soon, because disabling the worker tanks the performance in our game.

  • Use the border coordinates. If your border is a sprite, you can use Border.X or Border.BBoxLeft, Border.BBoxRight

    Or simply fixed values:

    Sprite is dragging: Set x to clamp (self.x, 200, 400)

  • Perhaps you need to use other values instead of ViewportLeft and ViewportRight

  • So object #1 should be dragged by simply touching anywhere on the screen, right?

    If #2 is a large invisible background sprite with Drag and Drop behavior, then on drag start you can attach #1 to #2 as a child with hierarchy. Then #1 will move with #2. On drop - remove the hierarchy.

    And while dragging limit the position of #1:

    Object2 On Drop
    OR Object2 is dragging : Object1 set x to clamp(self.x, left_border, right_border)
    
  • You can pass Array.AsJSON and set array from JSON string. But of course it's still cumbersome to use.

    Another option is to create multiple instances of array object, then you can store different data in each instance and pass array.UID as a parameter.

  • if param(x) == 0 && param(x+1) == "Set" >> set varaible to 0.

    Are you still using the old Function object? You really should update it to built-in functions. You will be able to name and set a proper type for each parameter.