N00B questions for a better solution

0 favourites
  • 3 posts
  • Hi,

    I'm not happy with my solutions - maybe you can help me out to find a better one

    1. if objPlayer is overlapping with 2 objEnemies then xxx

    Tried different ways with UID 1 and 2 and overlapping objPlayer but solved it right now with variables I set

    2. when dragging an object - it should get stopped when hitting a wall

    right now my workaround is to set the movingObject back where it came from (on drop)

    3. count objects

    Is there a way to if x objEnemies are on screen then…

    my solution right now is to set variables when objEnemies is destroyed/created

  • 1. "is overlapping" condition grabs some SOL. So you can simply check the SOL count. If it's equal to 2 then do something.

    2. On collision with wall just run "drop" action from Drag&drop behaviour.

    3. family.count returns the current number of objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • THX

    you solved 1 and 3 (where I am a little embarrassed that I totally forgot that I can use families - but I guessed it would be easy - that's why the n00b title)

    with your SOL (select object list) I am not sure if I took the right path, but I used objEnemy.pickedcount (still didn't figure out how to just use a condition)

    2. unsolved drag and drop

    If you drag the objPlayer to fast, then the drop on collision or overlapping drops the object into the objWall

    So I attached a capx where I use a follow every tick as long as in a certain area (this comes pretty close to what I want)

    The perfect solution would be that the dragged object gets repelled from objWalls and objEnemies (that's why I left a gap in the wall).

    The only solution I could think of is so complex I didn't even try if it would work, because I am pretty sure that there is a much nicer way to do it.

    So my solution would involve checking the drag angle and when objectPlayer hits an object it gets moved -180 degrees against the drag angle as long as it is overlapping (but I also should have to check where the wall is, so i only use X or Y).

    https://www.dropbox.com/s/b8ict3ibdh7fh ... .capx?dl=0

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