The Daily Click ::. Forums ::. Klik Coding Help ::. more than 360 degrees
 

Post Reply  Post Oekaki 
 

Posted By Message

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
16th January, 2006 at 03:12:32 -

This has probably been asked before but here goes anyways:

The traditional method for moving objects using sin and cos lets you have more than 32 degrees. Fair enough, but it still doesn't cover every pixel on the screen. I'm currently using this code for a little mouse controled shooter but there are still quite a few angles that my bullets wont go to. In some cases, its not noticable since my bullets have a degree of inaccuracy but in the case of the sniper rifle, its HIGHLY noticable.

I think the degree of accuracy has something to do with the 'speed' you multiply the cos(angle)/sin(angle) by, but thats the only way that I know of to make bullets more/less accurate. Does anyone know a better way to do shooting?

 
n/a

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
16th January, 2006 at 04:16:57 -

i am...

anyways i seemed to have fixed it slightly. Apparently using an alterable variable to store the x and y positions to move the bullet to before moving it makes it more accurate.... i have no idea why.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
16th January, 2006 at 05:46:09 -

Yeah, I was about to tell you to do that. You have to calculate and store the current position in variables, because otherwise it'll calculate the position properly but round it out when the object is placed. So the formula is working but future calculations are ignoring previous fractions.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click