Lock angle while in toward

0 favourites
  • 7 posts
  • I try to understand the catmullrom example made by R0J0hound (genius by the way) and I don't know how to prevent rotation when the sprite go toward. I woul like a isometric movement and not a top-view one. I tried to compare angle (in between condition) and set to 0 when this is greater than 0.1 and not work. Someone knows how can I do this? Thanks

    Example link: scirra.com/forum/follow-path-behavior_topic47235_page2.html

  • Let's ask R0J0Shtein the question

    R0J0hound , I know you are there ! Lurking in the dark ... Searching for post to resolve and to show your awesome genius unicorn solving skills even if it's really obvious that you are an awesome unicorn genius ... Oh man ... I scare myself sometimes !

    Cheers !

  • Someone could really help me. I already lost much time trying to solve this, without success. Please.

  • To make it have no rotation you will need to add another variable to the Sprites and call it "angle_toMove". Then istead of setting the angle of the sprite set that variable to angle(self.x,self.y,self.target.x,self.targety). You will also need to change the two "move forward" actions to "move at angle" actions, where the angle will be self.angle_toMove.

    I don't understand the isometric portion of the question, can you expound on what is different about isometric movement?

  • Salve R0J0hound. Thank you for this great script and for helping me.

    The Sprite now has stopped rotating. Thank you. However, the value defined for the "speed" variable no longer works. I assigned the "speed" value for the "Move" value (Move pixels self.speed at angle self.angle_toMove angle) on both actions, but not solved.

    Thank you again and sorry for the confusion about the analogy that I used to compare the type of motion.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound,

    I found the error: I forgot to include "* dt" in the expression that determines the speed. sorry.

    But the movement is not so smooth as before, when the sprite rotated. Now the sprite gives some leaps when changing the direction of motion.

  • The movement of the first example (http://dl.dropbox.com/u/5426011/examples 208/catmullrom.capx%) is very interesting. But I could not control the beginning of the movement, which is based on position change by time, right? I do not understand how to stop time and just launch it whenever you want. Could you show me the way to have this control?

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