dop2000's Recent Forum Activity

  • I've never had this issue on Android. Can you share a demo apk?

  • What you did is not right, the new code has essentially the same problem as in your first comment. If there are several bad troops within 500px from the good guy, the first badtroops instance will be picked as a target. Not necessarily the nearest. And if several good guys see the same bad guys, they will all pick the same one badtroops instance.

    Also, there is no point in using TargetUID variable if you are refreshing targets on every tick. The whole idea is to prevent this - once a goodtroop has a target, it will stick to it and will not be distracted by other targets.

    Picking by comparing distance is the same as using LOS behavior, but the LOS behavior works faster.

    Finally, your events 8 and 9 are also very wrong. They shouldn't be nested inside the loop. I suggest using Timer behavior to shoot a bullet.

    Here is how I would do the whole thing:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should probably use For Each loop if you want to assign a target for every good troop.

    For Each GoodTroops
    GoodTroops has LOS to BadTroops
    BadTroops pick nearest to GoodTroops
     .... GoodTroops Move To BadTroops
    

    But this may not work very well if there are several bad guys roughly at the same distance from the good guy - it will constantly switch targets.

    A proper solution would be saving the target UID in an instance variable on the GoodTroops. Once the target is selected, the good guy will move to it and ignore other targets until its target is destroyed. You can add other conditions to allow changing the selected target, for example, if another enemy has spawned much closer.

    .

    By the way, there is a mistake on your screenshot - in the first action you have Move To (Badtroops.X, Badtroops.X)

  • When you are using a condition like GoodTroops pick nearest to BadTroops.x/y, it will check all instances of GoodTroops, but only one (the first) instance of BadTroops.

    I suggest giving your family a Line Of Sight behavior and using it instead - GoodTroops has LOS to BadTroops.

  • Directly loading an image into a drawing canvas is still not possible. And doing this via a snapshot will be very slow. Can you paste canvas A on canvas B? This will work much faster.

  • Are you talking about a web game run in a browser on Android, or an Android app (apk)?

    I've never seen this issue in an apk. If this is a browser game you can use Chrome remote debugging to see if there are any error messages in the console log.

  • You are using Local Storage events wrong. Check out the official example:

    editor.construct.net

  • Sorry, you are right, I didn't that there are different lists.

    Even in Russian I don't understand your problem.. Can you post a demo project?

  • If both sprites are rectangular, you can use this condition:

    SpriteA.BBoxLeft<=SpriteB.BBoxLeft & SpriteA.BBoxRight>=SpriteB.BBoxRight & SpriteA.BBoxTop<=SpriteB.BBoxTop & SpriteA.BBoxBottom>=SpriteB.BBoxBottom

  • As Ashley likes to say, Answer your own performance questions with measurements :)

    How much data are you talking about? If it's less than 1MB I wouldn't worry about it at all.

  • You have duplicate "кто_написал2 Add item" actions on your screenshot.

    Also, "stop loop" after a delay will have no effect.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies