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 / Scatter shot

Author
Message
Wrath unleashed
16
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 18th Apr 2009 03:31
Ok I'm writing a program for school and I'm trying to build a scatter shot program. The only way I'm getting it to work is to make my player character rotate randomly while firing the weapon. The weapon fires premade projectiles. Does anybody know a better way?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 18th Apr 2009 22:11
what do you mean by "Scatter shot" and is this 3d 2d, rpg, fps, mmorpg(haha)

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 18th Apr 2009 22:43
if in 3d you could just make a cone for where it is hit. Or for the projectiles angle, take the angle of the gun +- a random number for the angle difference in both up/down and left/right angles.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 19th Apr 2009 18:41
Quote: "mmorpg(haha)"

roflmao

Quote: "what do you mean by "Scatter shot""

i think hes saying like a shotgun effect, where bullets fly everywhere, but make it coming from an automatic weapon

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Apr 2009 01:16
oh ya i'm dumb lol.

New Site! Check it out \/
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 11th May 2009 05:54
They have schools for Darkbasic?
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th May 2009 05:56
Quote: "They have schools for Darkbasic? "

Not that I know of, but some schools have game programming classes which USE darkbasic (since it IS free for schools, or used to be at least)

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th May 2009 00:08
How's this idea?

1. Take the point of impact from a normal shot
2. Apply a small random deviation to the contact point
3. Determine how many shell fragments should impact (5-7 pieces, or whatever)
4. Randomly place them around the contact point using a set maximum radius

[url="http://dbcc.zimnox.com"][/url]
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th May 2009 15:46
@phaelax
The problem with that is no matter how far away the contact point is, all the fragments will be the same distance apart.
You could include the distance in the calculations of course.

Riddle: The more you take, the more you leave behind. What are they? Answer

Login to post a reply

Server time is: 2025-06-08 07:20:58
Your offset time is: 2025-06-08 07:20:58