Hello again.
Hate to keep bothering you , But if Tom is reading this or anyone who understands 2d vectors, could you please give a hand.
If someone or tom could please explain why the mouseleft command won't move the sprite to strafe -90 degrees from the current direction but the mouseright strafe works perfectly. I am refering to Tom's code example above in his post. I have tried the mouseleft with different numbers such as -90 and the sprite won't move no matter what I do it seems.Have tried changing the +/- on the Cos and Sin to no avail. I have never heard of vectors until Tom fixed my problem so any help explaining why my code won't work will help a ton. Thanks in advance.
Hate to keep bothering you , But if Tom is reading this or anyone who understands 2d vectors, could you please give a hand.
If KeyDown(KEY_CONTROL)&KeyDown(KEY_MOUSERIGHT) 'use Sin & Cos to convert the angle in degrees to x,y translation values (a 2D Vector) px:+Sin(direction+90*movespeed) py:-Cos(direction+90*movespeed) If KeyDown(KEY_DOWN)&KeyDown(KEY_MOUSELEFT) 'use Sin & Cos to convert the angle in degrees to x,y translation values (a 2D Vector) px:+Sin(direction+270*movespeed) py:-Cos(direction+270*movespeed) End If
If someone or tom could please explain why the mouseleft command won't move the sprite to strafe -90 degrees from the current direction but the mouseright strafe works perfectly. I am refering to Tom's code example above in his post. I have tried the mouseleft with different numbers such as -90 and the sprite won't move no matter what I do it seems.Have tried changing the +/- on the Cos and Sin to no avail. I have never heard of vectors until Tom fixed my problem so any help explaining why my code won't work will help a ton. Thanks in advance.