How do I draw a line and sprite will follow it?

0 favourites
  • 2 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • I am creating a minified NFL semi-simulation game. How am I able to draw a line as routes for each player for them to follow those?

    Another problem I encountered is that whenever sprites/players are colliding each other they are stuck and do nothing but stop. I want them to get pushed for them to move again and continue chasing each other.

    Thank you guys, this is my first time to use a licensed account here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I used a rather crude method in this experiment and it mostly works, even when the lines take bends and slight curves.

    twistedvoid.com/antz

    To see it working, left click to drop food and click the button to turn pheromones on and watch their behavior when an ant finds the food.

    When an ant finds food it uses pathfinding to head back to the nest. As it travels, it creates a sprite on the layer under it (the red arrow) pointed in the direction it's travelling.

    When another ant encounters the red arrow sprite (is overlapping) it turns to face the opposite direction that sprite is pointed in and moves in that direction, constantly checking to see if it is overlapping.

    You can download the source at:

    twistedvoid.com/Antz.c3p

    Checking sprite collisions or the 'is overlapping' should help solve your other problems.

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