dop2000's Forum Posts

  • What's the point of posting the same thing over and over? Did you even read my replies?

  • That spike in collision checks is not normal. Check in the Debug Mode - make sure that only one instance of enemy is spawned (not thousands for example).

  • Check out this demo:

    dropbox.com/s/30gfm0rygew4bb0/MinimapRound.c3p

    It only works with rectangular objects. If you want to display any objects (with textures, different shapes, angles), you will have to paste them, it's a bit trickier, here is an example:

    dropbox.com/s/csn2fynev57mu9l/Minimap_DrawingCanvas.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can check if Enemy.count=0

    If you are adding new enemies, consider using a family for them.

  • You can do this with scripting:

    var obj = runtime.objects.Sprite.getFirstPickedInstance();
    var result=0;
    
    for (var key in obj.instVars) {
     result +=obj.instVars[key];
    }
    
    console.log("Result=" + result);
    

    But it may be more convenient in this case to use a dictionary or an array instead of a bunch of instance variables. Add the dictionary and the object to a container, and each instance of the object will have its own copy of the dictionary.

  • Here you go:

    dropbox.com/s/az95zmd2tac1wzv/ZombiePoker.c3p

    Тыкай зомби копьем :)

  • Try searching stackoverflow, there may be a different method to call .click() on Safari.

  • Do you mean when monster is overlapping an image point in another sprite, it dies? Like, for example, when player hits a monster with a sword?

    You need to use System Pick Overlapping Point event.

    Pick Monster Overlapping Point X=Player.ImagePointX("Sword"), Y=Player.ImagePointY("Sword")
    
  • You can ignore the turrets shooting system and make your own with Timer behavior:

    Note, that the last condition is inverted, it means "when turret does NOT have a target"

  • There is an addon which can do this:

    construct.net/en/forum/extending-construct-2/addons-29/behavior-pin-123766/page-5

    But it would probably be better to do with relative coordinates, as oosyrag suggested.

  • I forgot one more option:

    4. Import images for all levels into the project (in Files folder), and on start of layout load the required image into the Character sprite.

    This is not a good method, but it may work for some games.

  • Your profile says you are here since 2011. You have over 2000 posts on this forum! Surely you should know how basic things work in Construct.

    If you add the same object to multiple layouts, it is shared by these layouts. And obviously the image will be the same.

    Lets say you have your character sprite. If you want it to be red on level 1, green on level 2 and yellow on level 3, you have several options:

    1. Create multiple animations in the sprite - "Red", "Green", "Yellow". Set different animation on start of each level.
    2. Clone the character sprite, you will have CharacterRed, CharacterGreen, CharacterYellow. Combine them all into a family.
    3. Change color with an effect like "Tint" or "ReplaceColor".
  • I am really confused. You are using Construct for 10 years, why are you asking this question?

    You don't know that if you put a sprite on two different layouts, the image will be the same in both layouts?

  • I am not sure what you mean by the default animator. Can you just try this code?

    The animation in the first instance will run its course and trigger "On frame changed" and "On animation finished" events. All other instances will be synced to that first one.

  • The best way is to use Timer behavior. You can also use Line of Sight to check if there is a target nearby.

    For example:

    Enemy On Created
     : Enemy Start Timer "fire" for 1s (regular)
    
    Enemy On Timer "fire" 
    Enemy Has LineOfSight to Player 
     : Enemy spawn Bullet