Multiple Unit Movement

0 favourites
  • 3 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Hi.

    I'm playing with some RTS concepts. I am able to individually select different units and move them about the screen one at a time. However, the following example is giving me fits:

    I click a unit and click on the far right side of the screen. While that first unit is moving, I click a second unit and move it as well to another location. It begins to move as well. However, the first unit will no longer stop unit the second unit stops. I tried to record the clicked target locations first and then use a For Loop to check for each unit to fix the problem but that makes it so units move in the direction of a click but then stops immediately. Can anyone help with this? I have both movement problem available in the capx file. Toggle/Untoggle the lines to see both movement problems.

    Here is the link to my capx file

    RTS testing

    Thank you in advance for any help

  • I would use instance variables to keep track of where you want the units to go, and booleans to control selection and toggle movement.

    Here is a quick example I made, hope it helps: MultipleUnitMovement.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you very much Nixtrix. You not only solved my problem but added some nice features like the opacity to know a unit is selected and multiple selections at once.

    I don't see a way to give you reps so here's this instead:

    <img src="smileys/smiley32.gif" border="0" align="middle" />

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