#18076 - ProblemBaby - Sat Mar 20, 2004 2:46 am
why doesn't this code work??????????????
its fucks up after a while its like ball[0].Direction changes its value it is a u16
if I set what direction should be it works
i tried this and its work
and oh the sin and cos table has 361 values sin[360] = sin[0] and same for cos
Code: |
if (ball[0].x < 10 || ball[0].x > 230) { if (ball[0].Direction > 180) ball[0].Direction = 540 - ball[0].Direction; else ball[0].Direction = 180 - ball[0].Direction; } if (ball[0].y < 10 || ball[0].y > 150) { ball[0].Direction = 360 - ball[0].Direction; } |
its fucks up after a while its like ball[0].Direction changes its value it is a u16
if I set what direction should be it works
i tried this and its work
Code: |
if (ball[0].x < 10 || ball[0].x > 230) { if (330 > 180) ball[0].Direction = 540 - 330; else ball[0].Direction = 180 - ball[0].Direction; } if (ball[0].y < 10 || ball[0].y > 150) { // ball[0].Direction = 360 - ball[0].Direction; doesn't work in this case either ball[0].Direction = 360 - 330; // works fine! } |
and oh the sin and cos table has 361 values sin[360] = sin[0] and same for cos