dop2000's Forum Posts

  • LaurenceBedford

    There is LiteTween addon which is very similar.

    Or you can change size in "On every tick" event, or with Sine behavior.

  • This is not how you load data from json file into the array..

    You need to change your code like this:

    Note, that "For each element" loop is a sub-event under "On start of layout".

    Also, you have a very inefficient way of storing level objects in the array. You are basically designing the level in the array with numbers. Why not draw it on the TileMap in layout editor? It will be much easier.

    The traditional method is to store object types and their coordinates, something like this:

    wall, 100, 50
    wall, 120, 50
    wall, 150, 50
    chest, 200, 100
    zombie, 300, 120
    

    Of course, you don't enter these numbers manually, you prepare them using some kind of level editor.

  • Repeat 7 times
     Create object at x=(50+(loopindex%2)*100), y=(50+int(loopindex/2)*100)
    

    50px is the offset of the first object, 100px distance between them.

  • Your code is over-complicated. See this example:

    dropbox.com/s/mg6fdqs4e7g680v/CreateButtons.c3p

  • AllanR Your example is much more refined, although 22 events is probably a bit too many :)

    I guess it can be done even easier if instead of creating sprites in runtime, we put them all on a global layer in the editor, add an instance variable "Delay", set different delay values for different columns. And then simply start tween for each instance after a delay. Should be just a few lines of code.

  • I must say, I don't understand your code.. Why do you need ButtonNameDisplayLoop variable? It's local and not static, so it will always equal 0 when you call this function.

    Also, if you need buttons to be created in a horizontal line with 104px intervals, you need to pick the last button (rightmost), and then add 104 to its x-coordinate. On your screenshot you don't pick any button instance, so the first instance will be used. If you need to create more than 2 buttons, this will become a problem.

    Then, when you are creating a new button, you have ButtonNameDisplayY+72 as X coordinate, is this a typo, shouldn't it be ButtonNameDisplayX+72?

    Finally, you don't need the last event (pick instance by UID), you can set text right after you create the button, in the same event.

    .

    I suggest you carefully review your code, fix the issues, and use Debug Mode if there are still any problems.

  • Up!!!

  • Here is my version:

    dropbox.com/s/aarikmq8v8l72ax/DiamondTransition.c3p

    I'm using a global sprite on a global layer, which is not destroyed when you switch to another layout.

  • I believe the default audio format in C3 now is webm. If you re-import all sounds from wav, they will be converted to webm.

    See this article:

    construct.net/en/blogs/construct-official-blog-1/opus-audio-construct-891

  • Instance variables have a number of advantages over global variables, there is actually a plugin for that, take a look:

    construct.net/en/forum/extending-construct-2/addons-29/plugin-globals-120736

    .

    You don't have to use a sprite object on a global layer. You can use a dictionary or an array (they are set as Global by default), and define instance variables on them! For example, with PlayerStats array you can store some data in the array itself, plus you can have "health" and "speed" instance variables for easy access - for example "Set PlayerStats health to 100"

  • You need to have one default instance of this SpriteFont on any layout. I usually create an unused layout "Assets" and keep all such instances there.

    Also, try running the project in Debug mode and see if the instance is really created.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, I never realized that Fade doesn't have Stop action, sorry..

    You can set Fade wait time to a large number and restart fade, then on frame 15 set wait time to 0 and restart it again.

    Or you can use LiteTween behavior instead of Fade, you can definitely stop it. Maybe with LiteTween you will not have this issue at all.

  • Yeah, definitely looks like a bug. It works the same in C3.

    You can change collision polygon on the character sprite like this, it will work better.

    Use a different sprite for other collision checks.

  • Can you share a small capx demonstrating the issue?

  • Use BBoxLeft, BBoxRight, BBoxTop, BBoxBottom expressions to position your panels.

    "On collision" event is a bad choice here anyway, because collision checks are performed every tick and objects can travel big distances in one tick if the speed is high or FPS is low. So, for example if you are dragging a panel and want to stop when it collides with another panel, if you move your mouse too fast, you can easily drag it 100-200px too far.