Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2D bullet firing - I need help!!!

Author
Message
CammyF2003
21
Years of Service
User Offline
Joined: 10th Dec 2002
Location:
Posted: 10th Dec 2002 17:45
Im making an overhead tank two player game and i have the working 2 player movements complete with rotaion in 8 directions and forward,backward movements. The trouble is i now want to fire a red laser sprite in the direction they are facing. i can do the collition detection etc but just cant get the sprites to fire in all directions. please help
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 10th Dec 2002 23:41
I too just started the same thing
http://www.darkbasicpro.com/apollo/view.php?t=3089&b=8

Your tank
facing coordinate mods
N DEC Y
NE INC X, DEC Y
E INC X
SE INC X, INC Y
S INC Y
SW DEC X, INC Y
W DEC X
NW DEC X, DEC Y
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Dec 2002 00:48
wow, i might also do a game like that..but not in 2D

xxxpetratxxx
B. R. W
Programmer for Christ
21
Years of Service
User Offline
Joined: 15th Nov 2002
Location: United States
Posted: 11th Dec 2002 02:36
If you want to fire the laser in the diagonal at the same speed, you might try something a little more precise

the formula for the change in x and y is
r#=speed
x#=x#+ r#*cos( angle# )
y#=y#+ r#*sin( angle# )

this will work for infinite degrees.

Your life is important,
Others care about you,
Especially the one who made you.
Programmer for Christ
21
Years of Service
User Offline
Joined: 15th Nov 2002
Location: United States
Posted: 11th Dec 2002 02:37
I hope that helps

Your life is important,
Others care about you,
Especially the one who made you.

Login to post a reply

Server time is: 2024-03-29 14:23:30
Your offset time is: 2024-03-29 14:23:30