Condition for rotation

This forum is currently in read-only mode.
From the Asset Store
Have you tried to create realistic and at the same time casual tank movements? You found the perfect solution!
  • basicly i am making a spaceship. and i though that to make it feel more realistic the ship could have 3 x thrusters. the back one, left and right. if the ship fly forward the back one would work. if its rotating left - the right one would work, if right - the left one. and so on.

    the problem is neither i or my buddy can determinate a condition for that. as far as i checked theres no IF spriteX is rotating (counter)clockwise or IF angle is increasing/decreasing.

    the problem is that the ship is not conroled directly by the player. it has RTS beh that always forces him to fly to the Pointer sprite.

    any idea?

    the only option i see so far is to create my own custome made RTS behaviour but if its possibly i would prefer to avoide that (i am already far behind my deadlines and any additional work is a salty bite to swallow)

  • You can store the previous angle (either Sprite.Angle or Sprite[RTS].MovAngle) every 10 milliseconds (or similar) to a private variable, and then check the difference between them to check if a turn has been made.

  • we tried that. and it mostly works, with a few but very crusial exceptions..

    there is 360 degres total. now the spaceship is facing 10 degree. and he need to be turned LEFT to 350 degree. now, logicaly thats only 20 degress diffrence but the engine will count not the logical diffrence but the technical diffrence. for math jumping from 10 to 360 will be read as increased. even when you just gone down and came on the other end.

    i tested this =\</p>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just use the system object's condition "Angle is clockwise/anticlockwise of" ConstructWIKI (scroll down)

    That's what it's for <img src="smileys/smiley2.gif" border="0" align="middle">

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