Curves without pathfinding

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi everyone, I tried the pathfinding, I noticed that when it is the moment of the curve the sprite slows down, is it possible to always keep the same speed?

    I also tried to use simple waypoints without pathfinding, combined with move towards or bullet, setting the angle towards the next wayponint, in this case the speed seems to remain constant, the problem is that I would like my sprite to curve as it does with the pathfinding, but it actually sets the new angle instantly, how can I go about making it bend?

  • One way that’s pretty simple is to give your sprite an instance variable “target” and place the waypoints on the layout in the order you want to follow. You could alternately place the waypoints in any order and use an instance variable to set the order.

    Anyways the events would look like this:

    Every tick
    — sprite: move forward 100*dt pixels
    
    Sprite: on collision with waypoint
    — sprite: set target to waypoint.iid+1
    
    Pick waypoint instance sprite.target
    — sprite rotate 60*dt degrees toward (waypoint.x, waypoint.y)

    The 100 is the speed, and 60 is how fast it turns.

  • 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! I have never used rotate, tomorrow as soon as I can I try it, this should solve the problem !!

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