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 / Shooting code help...

Author
Message
Izzy545
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 15th Aug 2004 02:13
I can't get my shooting code to work... It goes funky, as in, I put a crosshair sprite at 320, 240 on the screen, and that should be the middle of the screen right? Well, I thought set object to camera orientation set it to the middle of the screen as well?

It doesn't seem to, as when I turn to the left, it shoots to the left of the crosshair, and when I turn to the right, it shoots to the right of the crosshair...

hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 16th Aug 2004 00:22
I'm not sure if this is your problem or not. At the end of your BulletMove sub, you have "position object 3,x,y,z" That shouldn't be necessary, as you are already moving the bullet with the move command. Also, are your camera positions being properly stored in the x#, y#, and z# variables. You could try changing that line to "position object 3,camera position x(),camera position y()+18,camera position z()"

Try that, and see what happens. Good luck on your game.

Izzy545
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 16th Aug 2004 01:40
You're a lifesaver! I will have to modify it when I add in gravity and all that, but for now it works perfectly! Thanks a ton!

Login to post a reply

Server time is: 2025-05-25 16:25:37
Your offset time is: 2025-05-25 16:25:37