dop2000's Forum Posts

  • tarek2 Yeah, this happened after I tried running the latest beta in Desktop app. Now both stable and beta versions are crashing...

  • Please help! After I login, the editor immediately crashes (closes). nwjs process keeps running in Task Manager. This started happening today..

    I updated NWJS to latest version, tried Storage Cleanup, but it didn't help.

    How can perform a "deep clean" of NWJS cache and other saved data? Is it safe to delete everything here?

  • Set the sprite invisible by default (in the editor). When the variable=1, set it visible.

  • how do I put in a an if or else function

    "if" is just a pseudocode. Use "System Compare variable" condition. And to add "Else" step, select that condition and press X on keyboard.

    when I run it like this it just displays a 1 when I click the button

    Maybe the text is too small? Also, the formula should be int(random(1, variable1+1))

  • aliiwhiite Don't use round() with random, it produces uneven results. To get a number from 1 to 1000 use int(random(1,1001))

    So the code should be something like this:

    Variable R=1000
    
    On button pressed
    ...Set R to int(random(1, R+1))
    
    .....Compare variable R=1 : Text set text to "You lost!"
    .....Else : Text set text to "Random value=" & R
    
    
  • I don't think it's possible without some manual editing of the project files.

    Note, that on export the folder structure will be flattened - all files will be moved to the root folder. So if you need to preserve folders in exported game, you probably shouldn't import them into the project.

  • Create AsJSON string for an array and dictionary with the same number of values, and compare which string is shorter. I think the array will the shorter, but if you use short key names in the dictionary, the difference may be small.

    The shortest option would be comma-separated values.

  • No, afaik this addon was not ported to C3. So you'll have to invent your own method of breaking the text into pages.

  • If you are using C2, you can try this addon:

    scirra.com/forum/behavior-scrolling-for-text-plugin_topic52557.html

    It allows to scroll long text page by page.

  • I can't tell you how to fix it without seeing your project file. But I am almost certain the problem is with polygons or origin image points in animation frames. Using a separate object for player movement should resolve it.

  • You can use an instance variable "curIndex" on the array.

    On Left key -> Array set curIndex to max(curIndex-1, 0)
    On Right key -> Array set curIndex to min(curIndex+1, Array.width-1)
    

    Then simply display the element from the Array.At(self.curIndex)

  • Did you delete you previous post? I've already written a long reply, so I'll post it here :)

    1. If you are using Platform behavior, move player only with Platform actions. "Move forward 1px" is not a Platform action, it will cause problems! Use "Simulate controls" action, check out the official Platformer template to see how to do it.

    2. I'm guessing that frames in your player animations have different collision polygons, or different size, or different origin point position, or maybe all of the above. This will mess with Platform events, because as animation is playing, your character will be constantly falling/landing/colliding with walls. To avoid this problem, use a separate invisible rectangular sprite "PlayerObject" for movement and pin your sprite with animations to it. Again, see "Kiwi store" template, how the Kiwi character is made there.

    3. Here is an example of how to manage animations in a platformer game:

  • You need to loop through all tiles, but it will be difficult to pick a random tile in a loop. So the easiest way is to put invisible "spawner" sprites. Then pick a random Spawner using "System pick random instance" action and spawn your object.

    To create spawner sprites:

    On start of the layout
    For "x" from 0 to Tilemap.Width/tile_width
    For "y" from 0 to Tilemap.height/tile_height
    ..Tilemap compare tile at (loopindex("x"), loopindex("y")) = 32
    ....Create Spawner at Tilemap.TileToPositionX(loopindex("x"), loopindex("y")), Tilemap.TileToPositionY(loopindex("x"), loopindex("y"))
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ormus Could you post a demo project? I made a quick test and with 200 rays cast on every tick, the difference in performance between 10 wall objects and 200 objects is not that big.

  • You are using a wrong action - "set animation" instead of "Set animation frame".

    And remove the quotation marks.

    Set animation frame to self.AnimationFrame+1