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.

DarkBASIC Discussion / i forgot how to do this again..

Author
Message
Mr_Insane
21
Years of Service
User Offline
Joined: 14th Nov 2002
Location: United States
Posted: 31st Dec 2002 10:27
Some simple space flight combat game I'm trying to make atm, I got the guns to work fine and everything..

now I need help on how to make the gun fire the lasers like the x-wing where 4 laser guns are fired from each corner all the time when the ship rotates and rolls etc.. gun coordinates for me is not good. it just gives out randon x/y/z location when it fires the laser.

is there a function to help fix this problem?
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 31st Dec 2002 17:41
probably best to do object position(x),(y),(z) with offsets for it ... then try to figure out the angle from that with a simple sin|cos

Anata aru kowagaru no watashi!
Red general
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 31st Dec 2002 20:44
I am also doing this thing, haven't worked out the multiple bulets but what I did was position the bullets where youre camera is e.g. x#,y#,z#
Just look at the code


hope this works, and posible you could adapt this so that it works for the four bullets

Red general
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 31st Dec 2002 20:45
P.s. it also works out distance from you and enemy and from the bullet and enemy, and where you are. I left those bits in in case you needed them

Login to post a reply

Server time is: 2024-04-24 07:29:27
Your offset time is: 2024-04-24 07:29:27