How do I make 2 objects follow a predefined path

0 favourites
  • 6 posts
From the Asset Store
Move around the rectangular and travel as much as you can!
  • Hey guys,

    I have a path and the x and y coordinates are in an array.

    Object 1 reads the x and y coordinates and starts moving. How do I make object 2 read the array from the beginning while object 1 is still getting data from the array?

    Greetz,

    Justin

  • I figured it out. I have 10 instances:

    global variable i=0

    Instance 1 starts at i (i=0 zero-based in the array)

    Instance 2 starts at -10+i = -10 element in the array

    Instance 3 starts at -20+i = -20 element in the array

    and so on and so on....

    add 1 to i and everything moves up 1 position

    So on start of layout I draw an attack wave with circular motion holding down the mouse button, the x and y mouse coordinates are then stored in the array, when the mouse button is released the enemy sprites load in the coordinates from the array one by one....this is cool if you want to make a game like Gyruss, Tempest or Galaga. These games have predefined attack waves

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am not sure but i think you can have the same thing done by using the Pathfinding Behavior.

    Not sure though, it's been years since i used that behavior but i am confident it can though.

  • Hi chadorireborn,

    I tried Pathfinding but it doesn't give you much control. In Pathfinding you have to make obstacles, right? Recording the mouse movement and then storing the data and reading it back in requires no obstacles. All you have to do is draw out the attack wave. Editing the data in excel gives you more control. But that's my opinion. I will make a link to the .capx file

  • So here is the link:

    https://app.box.com/s/1md304bnnrgb3i7wguu7kyrzvf8kt2hj

    Just hold down the left mouse button while drawing the path. When done release the mouse button.

    Greetz,

    Justin

  • I updated the link.

    Hold down the left mouse button while drawing the path for a single attack wave.

    Hold down the right mouse button while drawing the path for a double attack wave. (Like in Gyruss I love that game)

    All data is stored in the array. Let me know if this was helpful.

    Greetz,

    Justin

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