dop2000's Forum Posts

  • Nepeo Can I ask you a small question about Tween?

    I noticed that when you start a second tween (with the same tag) while the first tween is running, it doesn't "overwrite" the first one and the results are quite weird.. For example, if there are two actions like this:

    Sprite Tween X to 100 in 3 seconds
    Sprite Tween X to 500 in 2 seconds
    

    As a result, the sprite will move fast for about 580px in 2 seconds, and then slow down for the remaining 20px.

    Is it supposed to work like this, or is this a bug?

  • You can add an event like this:

    ToolTipText is visible
    Touch is NOT touching object -> ToolTipText set invisible (or destroy)
    
  • Your code makes no sense. Here is the correct sequence of events:

    1. You check if data in local storage exists (usually on start of first layout).

    2. If data exists, you load dictionary from local storage.

    3. If data is missing, you load some default variables from AJAX.

    4. On the end of each level you save the dictionary to local storage.

  • You can simply multiply all scores by 100 before submitting them.

    And then when you retrieve scores from the server to show on the leaderboard, divide them by 100.

  • dop2000 Glad you liked it, I've wanted to make this plugin for quite awhile so it's nice to hear it's appreciated. The plugin technically includes a seeded random, which is used for creating the noise. We're experimenting with integrating it with the System random expressions, which would be better than duplicating them in a different plugin. It's awkward to deprecate expressions so we didn't want to expose it on the new plugin just to remove it later.

    Nepeo In C2 I'm using this plugin for seeded random. It somehow integrates with all the system random events and expressions (random, choose, pick random instance etc). It would be great to have the same functionality in C3.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check the source code, maybe there is an floor/round/ceil/trunk function somewhere.

  • Container is a good idea. Add arrow to the same container with troop sprite. When you pick a troop instance, its own arrow will be picked automatically. When arrow is not needed, make it invisible.

    If you make an event like "Arrow set position to troop", each arrow will set position to its own instance of troop, because they are in the same container, and you don't even need "for each" loop here.

    Add a bunch of instance variables to troop - for example targetX, targerY, hasRoute etc.

    If I understand correctly, only one troop can be active at a time, so instead of the instance variable isActive, it may be easier to use a global variable activeTroopUID. When a troop is tapped, set activeTroopUID=troop.UID, and then you will be able to pick this troop by its UID in any other event.

    On confirmed destination tile set targetX, targerY to tile x/y.

    On 'Skip turn' you can start moving every troop to its own target tile (targetX and targerY). I suggest MoveTo behavior, but you can use something else.

  • I thought you were still talking about that arrow. If you have several sprite instances and only need to move one, you need to pick it before moving. You can set an instance variable isMoving=true to that instance, or pick it by UID or use some other condition.

  • Instance variable are for permanently storing some values for each instance. Say, if you have Enemy sprite, you might want to add "health" instance variable to it.

    In this event I added a temporary variable, just to make the code simpler. I don't need to keep this variable after the event. So a simple local variable is sufficient.

  • Also try googling something like bullet arc site:construct.net

    This is a very popular question and you may find lots of different solutions.

  • Really cool tutorial, thank you!

    But when I read about advanced random plugin, first thing I thought of was seeded random. Are there plans to add this feature?

  • You do not have permission to view this post

  • With local variables the code is easier to read, and easier to modify if needed. Performance-wise there should be no difference, unless you are doing these calculations millions times per second. (which is not the case)

  • You can download an old version and test, but I doubt it's related to Construct version. Probably some mistake in your project.

  • Open .caproj file in Notepad or other editor, scroll to the end and check if the file is in the correct folder, edit if necessary: