dop2000's Recent Forum Activity

  • If you add "ID" variable to the object, you can use it to pick object instances. You can also pick by UID, IID and several dozens of other criteria.

  • You should be able to optimize at least some of the code.

    For example, if you place each Text object close to its sprite on the layout, you can do this:

    For each text 
     Pick nearest SpriteFamily -> Pin Text to SpriteFamily
    

    Or you can add an instance variable PinToUID to the Text (or TextFamily), and manually specify which sprite each text should be pinned to. Then your event will look like this:

    For each text
     Pick SpriteFamily by unique ID=Text.PinToUID -> Pin text to SpriteFamily
    

    .

    It could be even easier if you use an invisible BaseSprite as a placeholder for each group of objects.

    For each BaseSprite:
     SpriteFamily is overlapping BaseSprite -> Pin SpriteFamily to BaseSprite
     Text is overlapping BaseSprite -> Pin Text to BaseSprite
    
    
  • It's all about picking. You can first pick enemies by distance. If your event picked multiple enemies at that distance, then you pick one enemy from them by some other criteria - for example, the enemy with lowest health, or simply random. And then fight that enemy.

    RadYan is right - you have to be more specific.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, sorry, you are right and I was wrong.. Wow, I always thought IID depends on the picked scope.

  • (removed, I was wrong)

  • Family is often the easiest way to work with two different instances of the same object in one event. However, since you need to copy instance variables, this means that you'll have to define those variables on the family level.

    If you don't want to do this, then you'll have to use a bunch of temporary local variables..

  • Dop2000, a different poster totally, they are not his capx files

    Oops, my apologies! This whole topic is quite confusing.

  • I thought you don't want to use collision checks? "Is Overlapping" condition in your first capx still uses them. And those events #2 and #6 from the second capx make absolutely no sense.

    If you don't want to use "On collision" or "Is overlapping" events, you can use "Pick nearest enemy to player", and/or compare distance between player and enemy and pick enemy instance within some short distance.

    Keyboard on Space pressed
     Enemy pick nearest to player.x, player.y
     distance(enemy.x, enemy.y, player.x, player.y)<20 : enemy destroy
    

    Still don't understand your problem, as in both your capx only one enemy instance is destroyed at a time.

  • You need to post your capx or at least a screenshot of your event sheet.

  • I don't know why it doesn't work for you.

    Try this demo:

    dropbox.com/s/fytd9r6f0x4l5jo/DragWithPadding.c3p

  • Yes, I meant "On drop".

    To add an image into post, use img tag, for example:

    [img=1234]

    It would be much easier to help if you could share your code or your project file.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 273 followers

Connect with dop2000

Trophy Case

  • 9-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
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

29/44
How to earn trophies