Name: Anonymous 2009-07-17 0:13
To do this I know you need to use trig functions, but I cant seem to get it right. Anyone know of some source code that does this properly?
x = sin(angle) * magnitude + centre_x and y = cos(angle) * magnitude + centre_y or something like thatangle every frame for rotation.
if(left)
{
try {
Thread.sleep(100);
}
catch (Exception e) {
}
System.out.println("" + dx);
dx = dx*Math.cos(9) - dy*Math.sin(9);
dy = dy*Math.cos(9) + dx*Math.sin(9);
}
if(right)
{
try {
Thread.sleep(100);
}
catch (Exception e) {
}
dx = dx*Math.cos(9) + dy*Math.sin(9);
dy = dy*Math.cos(9) - dx*Math.sin(9);
}
velocity variable instead of that massive if clause.
try {
....
}
catch (Exception e) {
}dynamic-wind
(catch 'test
(unwind-protect
(throw 'test 'actual-result)
(princ "always executed"))
(princ "missed"))