|
how to draw sprite from 0,0 to mouse x y? |
rxtype
Member #8,352
February 2007
|
im trying to make a simple game where the player shoots stuff on the screen by aiming with the mouse. when the player clicks mouse b 1, you will see the bullet firing off lets say x0y0 to the mouse's position. i tried to make my bullet move by x++ y++, but that will not make it travel in a straight line. how can i make this work?? i cant think of a solution.. |
kazzmir
Member #1,786
December 2001
|
Wouldn't it just be Or something? I usually just use angles
|
rxtype
Member #8,352
February 2007
|
i tried using ur angle code, but i get errors.. error C2664: 'atan2' : cannot convert parameter 1 from 'volatile int' to 'fix' |
kazzmir
Member #1,786
December 2001
|
Include math.h before allegro.h. |
rxtype
Member #8,352
February 2007
|
thank you!!!! |
|