dop2000's Forum Posts

  • The easiest solution - add ScrollTo behavior to your character.

  • First screenshot:

    You can combine all 4 conditions into "Or" block, it will be a bit bulky but it will be one event.

    Or you can change all four condition to this one:

    System -> Compare two values-> (bgg=7 | bgg=14 | bgg=21 | bgg=28) = 1

    Second screenshot:

    TakHarf On frame changed -> Set WallpaperCount to (TakHarf.AnimationFrame>7 ? (TakHarf.AnimationFrame-7) : TakHarf.AnimationFrame)

    (if there are no more than 14 frames in this animation)

    There also was an update for Windows 10 released a few days ago to address that major security flaw in Intel processors:

    https://support.microsoft.com/en-us/hel ... -kb4056892

    I feel like after installing it my C2 runs much slower.

  • No, that's not an infinite loop. If your sprite is tiny and the layout is big, this can be a very long loop, but still not infinite.

  • work3

    Delete "Create object" action from event #1

    Create a sub-event (press B) under #1 and move event #2 into this sub-event.

  • Check out the Spriter plugin:

    https://www.scirra.com/blog/119/spriter ... onstruct-2

    how-to-use-spriter-animations-in-construct2_t106100

    I think it can do smooth transitions between animations.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've successfully completed a couple of small jobs and ready for new projects!

    Tried your capx on 2 laptops (both with r246 version of C2):

    New i5-7200U, 8Gb RAM, SSD, Win 10 - project took 3.5 minutes to load, dialogs take 5-10 seconds to open, everything is laggy.

    Five years old i7-3630QM, 8Gb RAM, SSD, Win 8.1 - project took 3+ minutes to load, but dialogs are opening almost instantly, previewing is also fast.

    Looks like you are right, performance is much better on older machines.

  • breflabb

    You'll probably not get any replies here.

    Consider posting your capx in "How do I..." subforum.

  • AJAX On Completed is a triggered event.

    My guess is that when AJAX request with tag "MYLEVEL7" (for example) is completed and at this moment your variable LVL_LOOP is not equal 7, then this event is skipped.

    How many levels do you have? You can simply make something this:

    AJAX On "MYLEVEL1" Completed -> Function call LoadLevelData(AJAX.LastData, 1)

    AJAX On "MYLEVEL2" Completed -> Function call LoadLevelData(AJAX.LastData, 2)

    AJAX On "MYLEVEL3" Completed -> Function call LoadLevelData(AJAX.LastData, 3)

    etc.

  • Containers are easy once you understand how they work. Objects in the container only exist together.

    If one object from the container is created, all other objects from the same container will be created automatically. So you spawn an enemy and don't need to create its head! (but you still need to position it correctly and then pin).

    If you create a head, another enemy will be created.

    You destroy an enemy, its head will be destroyed too.

    If you put enemies and their heads onto the layout in editor and do this out of order, then you may attach wrong heads to wrong bodies! That's probably why all those weird things you mentioned are happening.

    To your second question - PinnedUID is an expression of Pin behavior. When you pin head to the enemy, Head.Pin.PinnedUID contains UID (unique ID) of the enemy instance. (Sorry, I missed the .Pin bit in my previous comment)

    So with this expression you can find the enemy to which the head is pinned using "Enemy -> Pick by unique ID=Head.Pin.PinnedUID"

    or you can find the head using "System-> pick by comparison Head where Head.Pin.PinnedUID=Enemy.UID"

    The third and very popular option is to create an instance variable EnemyUID on the Head sprite. When you create a new Head, you will need to put Enemy's UID to this variable.

    Then you can pick the Head using "Head -> Compare Instance variable EnemyUID=Enemy.UID"

    Or you can pick the Enemy using "Enemy -> Pick by Unique ID = Head.EnemyUID"

    Endless possibilities!

  • Container is the right way to do this. Add enemy and head into a container. When these two objects are in container, each pair of enemy+head instances will be logically linked together.

    If you place enemies on the layout manually in editor, put one enemy and one head first, then copy-paste them.

    If enemies are spawned during the game, you only need to create enemy object, head will be created automatically.

    Same with destroying - only destroy enemy object, its head will be destroyed automatically.

    If you want to do this without the container, you can use PinnedUID expression. Something like this:

    Enemy on destroyed:

    System-> pick by comparison EnemyHead where EnemyHead.PinnedUID=Enemy.UID -> EnemyHead Destroy

  • I've seen your post in C2 forum and I tried your project in both C2 and C3.

    If I look very-very closely to the screen, I can see a few pixels on the right side flickering just a little bit. But it's so minor that I would've never noticed it if I wasn't looking for it specifically. It's definitely not "flickery to the point of unplayability"

    So there must be something wrong on your side, maybe try updating video card drivers?

  • "CollectableSprite" is your sprite, I don't know how you named it in your project (could be "Coin" or something else).

    ".Count" is an expression, which return the number of sprite instances on your layout.

    Create a variable TotalCollectables.

    Add this event to your "On start of layout":

    Set TotalCollectables to CollectableSprite.count

    Then you can display TotalCollectables in that text:

    System-> every tick -> define text : Player.PlayerCoin & "/" & TotalCollectables

  • Use CollectibleSprite.Count to get the number of all instances of this object on the layout.

    So you can create a variable TotalCollectibles and set it to CollectibleSprite.Count at start of the layout.