dop2000's Forum Posts

  • You can't do this - animationsList&"_points" - with variable names.

    You'll need a temporary variable s and a bunch of events like:

    If CategoryNumber=1 Set s to Category1_points

    If CategoryNumber=2 Set s to Category2_points

    Or you can store your lists of points in a dictionary, under keys "Category1_points", "Category2_points" and do this:

    s=PointsDictionary.Get("Category" & CategoryNumber & "_points")

    Add int(tokenat(s, Sprite1.animationFrame, ",")) to totalPoints

  • Did you set "Force own textures=Yes" on the layer? Some blend modes don't work without it.

    https://www.dropbox.com/s/c2tf92q8o5dmq ... .capx?dl=0

  • "Set effect parameter" takes values from 0 to 100 and for setting red, green and blue channels you need three actions, for example:

    Sprite-> Set effect "SetColor" parameter 0 to 50

    Sprite-> Set effect "SetColor" parameter 1 to 70

    Sprite-> Set effect "SetColor" parameter 2 to 100

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • bbjGames

    "For Each" loop is working and it does process each of the Brain instances.

    The problem is with the sub-events. I believe you need to reset the variables to their initial values (x=4, y=0, z=-1) in event #36.

    Alternatively, you can move variables declaration inside the "For each" loop, then they will be reset automatically.

    You might also want to reset them in between "Repeat 30 times" and "Repeat 16 times" loops.

    The "mutate" variable always equals 5, so all events with condition "mutate<=2" will never work.

    There may be other mistakes in those loops, I really don't understand what are you doing there.

  • I'm not sure what's going on in your code, but the For each loop is working and it does change each of the 5 Brain arrays.

    You can check it yourself - run the game in Debug mode, select one of the arrays and see the values changing every 5 seconds.

    You can also add Browser->Log to this loop to output debug messages.

    For example: Browser Log Brain.UID, you'll see that all 5 Brain UIDs are processed.

  • GabrielIq

    You need to save the skin in a global variable (or a dictionary). On start of another layout, set animation frame to skin variable.

  • Yes.

    And also, I suggest you replace "Pause timer" with "Remove timer" in event #8 too.

    Then you will be able to check if the timer is running by comparing Timer1.ElapsedTime("UpgradeTimer")

    If ElapsedTime=0, the timer is not running, if it's >0, then it's running.

    You could remove the OnUpgrade variable and all those events where you save/load it to local storage.

  • I know one scenario where Pin behavior can cause lagging:

    Create 3 sprites A, B, C.

    Add Bullet or Drag and Drop behavior to A.

    Pin B to A.

    On every tick set C sprite position to (B.x, B.y)

    You'll see that A and B move together, but C is lagging behind. I'm guessing that's because Pin behavior updates coordinates of pinned objects at the end of the frame, after all other behaviors and events.

    So maybe you have something similar in your game. The solution would be not to use (x, y) coordinates of pinned objects in any events or calculations.

    [quote:15t8snbl]Just as a query what is the standard procedure for pinning an object, create then pin, right?? it doesn't need an every tick function or anything, I am assuming??

    Correct. Create and pin, no need to "re-pin" on every tick.

  • Sure, but you'll need to figure out the ratio of movement speed to animation speed.

    Say, if normal movement speed is 50px/sec and normal animation speed is 10 frames/sec, then you can do this:

    Sprite Set Animation Speed to (MovementSpeed/5)

    When movement speed increases to 100px/sec, animation speed will also increase to 20 frames/sec.

    Or if you want a much bigger increase in animation speed, you can modify the formula to something like this:

    Sprite Set Animation Speed to (10+(MovementSpeed-50)/2)

  • Could you share a capx demonstrating the problem?

  • On start of layout all sprites used on this layout with all their animation frames are loaded into the memory.

    So having a separate object for each layout is better for performance.

  • Does the number of coins decreases?

    Please share your capx, it's hard to guess what could be causing the problem without it.

  • Interinactive, I replied you in PM