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.

Newcomers DBPro Corner / Trouble positioning bullets..

Author
Message
JJJ0han
16
Years of Service
User Offline
Joined: 4th Oct 2007
Location: Brisbane, Australia
Posted: 3rd Nov 2007 00:42
I've got visible bullets, they work very well, but the only problem is the placement. I want them to be positioned slightly to the right of the player each time.

This works, but goes horribly wrong when the player is facing the opposite direction which causes the bullets to actually get fired from the left side of the screen instead of the right.

Here's the cut-down firing code with just the bullet's role:
object 4 is the bullet
object 2 is the player


Here's the player's rotation:
Guyra
18
Years of Service
User Offline
Joined: 10th Nov 2005
Location: Norway
Posted: 3rd Nov 2007 00:46
You could fix this by using the commands:
NEWXVALUE(Current X Value, Angle Value, Step Value)
NEWZVALUE(Current Z Value, Angle Value, Step Value)

JJJ0han
16
Years of Service
User Offline
Joined: 4th Oct 2007
Location: Brisbane, Australia
Posted: 3rd Nov 2007 01:04 Edited at: 3rd Nov 2007 01:05
Hmm, could you give me some help with that? I haven't used the command before and I'm not exactly sure what to use for the values.

NEWXVALUE(X#, 0, Step 5)
NEWZVALUE(x#, 0, Step 5)

Would that be right?

Also when I try to run it, it says "Could not understand command"

I've got the latest version of DarkBASIC not sure why it says that.

I've found an alternative, but now its stuffing up with the Y positioning when I look up or down .

Guyra
18
Years of Service
User Offline
Joined: 10th Nov 2005
Location: Norway
Posted: 3rd Nov 2007 01:33 Edited at: 3rd Nov 2007 01:35
Something like this should do it:


..and you're using DBPro and not DBClassic, right?

Login to post a reply

Server time is: 2024-09-27 08:23:37
Your offset time is: 2024-09-27 08:23:37