Rotate Layer Jumps Degrees with Keyboard Controls

  • This is my first time using Construct 2 and I am having trouble understanding what is going on.

    First what is the point in having to set 2 points.

    angle(sprite2.X,sprite2.Y, center.X, center.Y)

    I understand you need two points to create a circle, center point and distance but it doesn't seem that the position of sprite 2 makes a difference since the whole layer should be rotating.

    Next Question is I am having a problem with the angle jumping when swithcing from left to right (or right to left) movement. It jumps several degrees instead of a nice clean 1 degree. If you tap the right/left button it sometime will be 5 to 20?. Not sure what is going on. (There is probably a better way to set the angle instead of a counter)

    Problem with Rotation

    Version 2 center point.

    Thanks for your help!

  • Nevermind I got it to work thanks to Weishaupt post

    Center to Viewport

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I will answer your first question. angle(X1, X2, Y1, Y2).   With this option you need a line to set an angle (because that angle compares with an imaginary line on the x axis.) So, X1,Y1 to X2,Y2 draws this line in memory so the computer can calculate the direction/angle compared to the x axis...   

    This works great to position a sprite facing toward another sprite or the mouse every tick of the program.   Does that make sense?

    At least that is how I make sense of it...

  • Yep I get it now, I just didn't see the relationship of the X1,Y1. Awesome thanks for the answering the question. <img src="smileys/smiley1.gif" border="0" align="middle" />

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