About follow the path

mintmomegmintmomeg Member, PRO Posts: 261
edited June 2012 in Working with GS (Mac)
Is there any way to do follow the path as same as Harbour Master game




or do as you see below




Best Answers

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    instead of interpolate use move to
  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    edited June 2012 Accepted Answer
    then you need to say that haha. You were making it seem like you want someone to tell you how to make the enitre game.

    For the rotation based on direction

    constrain self.rotation to vectorToAngle(self.motion.linear.x,self.motion.linear.y)

Answers

  • EatingMyHatEatingMyHat Member Posts: 1,246
    You can probably do it now with writable tables. I think TshirtBooth have a video on it, look it up on gshelper.com.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mintmomegmintmomeg Member, PRO Posts: 261
    Sorry that one is not answer that I look for... in Tshirtbooth video I already see but if you see in video all object already move and then you draw path then object follow the path with same speed but in vDO they use self. attribute position which speed change then after postion move to last x, y of table they stop. also item that move x,y follow path not turn too
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Not sure what your saying but tshirts video is more then enough to get you started doing this. Thats basically everything you need you just have to adjust it to your needs.
  • mintmomegmintmomeg Member, PRO Posts: 261
    sorry for my poor english ... In the recent "How to draw a path, and have an actor follow it" demo, i understand that the actor isn't "moving" as such, but instead interpolating the X&Y every 'n' seconds to the next location in the table. I also understand that the speed at which the actor interpolates to each of the new positions in controlled by the timers, that update these positions, and the interpolate length.
    Because of this set up the actor has no 'velocity' to control, and so i wanted to know if there is a way to have the actor move at a constant speed or apply a max speed, rather than the current system where by the faster you draw the line, the faster the actor follows it once the mouse button is up???

    I think it will require altering the way in which the table is populated with new X&Y co-ords etc, or somehow making the speed at which the timers fire related to the distance between positions in the rows in the table, probably using magnitude, but can't figure it out.
  • mintmomegmintmomeg Member, PRO Posts: 261
    sorry for my poor english ... In the recent "How to draw a path, and have an actor follow it" demo, i understand that the actor isn't "moving" as such, but instead interpolating the X&Y every 'n' seconds to the next location in the table. I also understand that the speed at which the actor interpolates to each of the new positions in controlled by the timers, that update these positions, and the interpolate length.
    Because of this set up the actor has no 'velocity' to control, and so i wanted to know if there is a way to have the actor move at a constant speed or apply a max speed, rather than the current system where by the faster you draw the line, the faster the actor follows it once the mouse button is up???

    I think it will require altering the way in which the table is populated with new X&Y co-ords etc, or somehow making the speed at which the timers fire related to the distance between positions in the rows in the table, probably using magnitude, but can't figure it out.
  • mintmomegmintmomeg Member, PRO Posts: 261
    edited June 2012
    @johnpapiomitis I already try move to problem is when move to last position then they stop move at that position. how can I let move to same direction of last position go
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    so then set up rules when they reach that last position to do whatever you want. Like i said before everything you need to do this is in this thread, you need to change it and do some work to adjust it to your needs.
  • mintmomegmintmomeg Member, PRO Posts: 261
    edited June 2012
    I already do but problem is Math that tell angle or direction that they go on the last position and also math that tell how to rotate object to the direction that they go
  • mintmomegmintmomeg Member, PRO Posts: 261
    edited June 2012
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    I just told you how to do that.
Sign In or Register to comment.