Results 1 to 3 of 3

Thread: Angles question

  1. #1

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  2. #2
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    well..

    Ball(i).x = Ball(i).x + Sin(Ball(i).Angle) * 5
    Ball(i).y = Ball(i).y + Cos(Ball(i).Angle) * 5

    First of all change *5 to *speed so you can increase difficulty.
    Secondly, it MAY be a radians/degrees problem.

    Try this:

    Ball(i).x = Ball(i).x + Sin(Ball(i).Angle*3.14/180) * ball(i).speed
    Ball(i).y = Ball(i).y + Cos(Ball(i).Angle*3.14/180) * ball(i).speed

    *Pi/180 converts degrees to radians, to change back to *180/Pi

    I'm pretty sure this is your problem.
    Don't pay attention to this signature, it's contradictory.

  3. #3

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    Yes, thanks!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width