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 / Probably been asked, but I can't find it :( ...

Author
Message
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 17th Sep 2005 00:26
I'm making an FPS, and I need help with the collision.

When I make the bullets move fast, they just go though an object like a building, because they move so fast.

So I put the movement code in a for loop, and had it move a little bit at a time, and that worked, but it still wasn't fast enough, so I increased the number of times it loops, but that made the game run too slow.

What do I do?

Please don't tell me to get neaclear glory.

Thanx.

--------------
Uncle Sam
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Sep 2005 00:58 Edited at: 17th Sep 2005 00:59
You are doing what I tried - and it doesn't work.

Don't even bother trying to show the bullets. They move so fast in real life that you don't see them, so why bother in a game.

Concentrate on whether the bullet (if there was one) would hit the target. If it would, then the target goes down. If not - it doesn't.

A shooting sound shows the player has fired - maybe with a bit of recoil. That's all you need.

TDK_Man

SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 17th Sep 2005 01:34
moving bullets really isn't a problem, as long as you don't have too many...

In my program bullets will move 3000 units a second on full speed at a constant 30 FPS... when you have more than like 15 bullets active, it does indeed become a problem and the game will slow right down to about 4 - 5 FPS...

You shouldn't need to keep your bullets for more than about 5 frames, if they've not hit something by then, it's probably too far to see the object you hit anyway, so delete it...

if you have loads of other objects loaded, it might be an idea to move it 5 times in the same frame and delete it again, so you're only ever dealing with 1 at a time, and keep the FPS high-ish...

...maybe one day I'll finish a project
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 17th Sep 2005 02:19
Thanx guys.

TDK, how would I make it see if it WOULD have hit anything?

--------------
Uncle Sam
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Sep 2005 05:48
Check out the help files for 'static line of sight'.

TDK_Man

Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 17th Sep 2005 06:51
Well, I thought of that, but my gun can aim left and right [b]as well as[b] up and down, so I'm not sure how to make it rotate to the angle of the camera.

--------------
Uncle Sam
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 17th Sep 2005 13:32
rotate object bullet,camera angle x(),camera angle y(),0

[href][/href]
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 17th Sep 2005 20:08
I'm talking about static line of sight.

--------------
Uncle Sam

Login to post a reply

Server time is: 2025-05-22 13:28:52
Your offset time is: 2025-05-22 13:28:52