Pick enemy according to proximity, camera drag.

0 favourites
  • 3 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hello, I recently started using C2 and I've looked at quite a lot of tutorials, but I couldn't find anywhere how to solve this problem. I want to make a 2D rpg for touch screen devices, so here's what I did:


    As you can see, you will only shoot arrows when the enemies are in range, but the problem is the arrows always go towards enemies in the same order(That is, the order in which the enemies were created) instead of going to the closest one, so you will always attack the same enemy no matter where you are. How can I fix this?

    A much smaller issue(which I already tried to fix until I gave up): I want to make the camera follow the player(moving slightly slower than the player), then make the camera go a little faster when you release the button until it gets to the player position, as smoothly as possible. The problem is the camera sprite keeps moving around the center of the player forever, vibrating.

    Thanks for your time, guys . <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1) just use the pick nearest/furthest condition under the objects pick commands

    2) add a condition which checks the distance using the distance expression under the system object, so the condition is only met if it is above say 1 pixel.

  • I've just read about both of those things but I'm still confused. Can you be more specific?

    1) Which object should pick which? The projectiles or the enemies(coloured balls)? I've tried some things but the projectiles keep homing towards the balls in the same order.

    <font color=cyan>2) I understand what you're saying I have to do, but I'm not sure how to do it. Would that be a 'compare 2 values' condition?</font>Edit: Nevermind, number 2 is solved.


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)