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.
i tried making a temp variable temp = mouse_x / mouse_y and have x add temp when mouse_x > mouse_y, but that doesnt work well either..
how can i make this work?? i cant think of a solution..
Wouldn't it just be
Or something? I usually just use angles
i tried using ur angle code, but i get errors..
error C2664: 'atan2' : cannot convert parameter 1 from 'volatile int' to 'fix'
error C2664: 'cos' : cannot convert parameter 1 from 'double' to 'fix'
error C2664: 'sin' : cannot convert parameter 1 from 'double' to 'fix'
Constructor for class 'fix' is declared 'explicit'
Include math.h before allegro.h.
thank you!!!!