Two enemies close in when in center

This forum is currently in read-only mode.
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Hello everyone, I'm not sure how to word this subject wise

    Here's a little pic of the game to illustrate the scenario

    <img src="http://www.fileden.com/files/2008/3/4/1796632/chopet.PNG">

    What I'm trying to do is have the two ball guys (chompets) stay stationary when you are not between them, but as soon as you are in the middle of the two, they move forward in center to bite you. Once you are out of the middle of them, they retreat back to their normal positions.

    Argh I'm so out of shape in coding...

  • Dog X greater then Ball1 X

    *Dog X lower then Ball2 X

    -Move together

    Else

    -Move back again.

    Or is that how the else event works?

  • You could also just use a simple detector which is the same size as the space between the chompets...

    Player is colliding with detector

    -Chompets movement start

    Player is NOT colliding with detector

    -Chompets do nothing

    Apart from making a bit of code that returns them to normal position, that would probably be one way of doing it, though with math it wouldn't matter how far apart they were and it would still work without having to make various detector objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks guys I'll try it out. I was having brain poos yesterday

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