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 / to shoot!

Author
Message
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 18:35 Edited at: 21st Feb 2006 01:06
ok iknow there are alot of post on this but tell me if i have the right idea!


what would i put after the else to make the sphere come from the gun and go where the crosshair is! here is my code!


thank you!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Xarshi
19
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 18th Feb 2006 19:42 Edited at: 18th Feb 2006 19:43


that should work.im not too sure,havent used dbc in a long time.dbp is better

...
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 19:49
that didnt really help!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 20:21
is there a way like how i did it!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 18th Feb 2006 20:58
I think you should make a crosshair on a plane , rotate it to look directly to the player (camera , whatever) , make it transparent (with ghost object command) , and lock it .

RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 18th Feb 2006 21:02
That wont help either ...

Dont have time to get into the code but basically,

- When the user Clicks the mouse
- Position the bullet at the user's position
- Rotate the bullet to be the user's rotation (on the x and y axis)
- Move the bullet forward
- Check for collision as the bullet is moving

Not the most efficient way but experiment and you'll get it.

DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 21:13
i dont know how to do those kinds of commands!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 18th Feb 2006 21:27
uhh...
If
Mouseclick()
Position object
Rotate object
Move object
endif

You dont know those commands?

"Forgiveness is a good thing"
"Forgiveness is between them, and God. I set up the meeting"
-Man on Fire
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 18th Feb 2006 21:44
If you dont know how to do them, you're doing something way to complicated. Look at some tutorials, then move onto something harder.

DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 23:05
ok i am also working on a pong game i will stick with that for a bit i guess! thank you!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 23:07
well i actualy do know those commands but im not good with them!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 19th Feb 2006 00:34 Edited at: 19th Feb 2006 00:36
Here is a basic code I just wrote:


It's a third person with shooting, you should get a basic idea of how you could make a shooting system with that... Walk around with the arrowkeys and shoot by pressing the spacebar....

Just note a few things in this code... The bullets you shoot out dosn't get deleted any time... In your game, be sure to somehow delete bullets again!

This isn't the best way of doing things... You could eventually use something like raycasting for shooting systems... For something like fps shooting system, you would problaly be best off using raycasting.

Hope it helps a bit

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 23rd Feb 2006 12:57
Quote: "
type playerBul
bulletsExist as integer
shootCounter as integer
bulletSpeed as integer
endtype
"


Can't do that in DBC - doesn't support the type command.

the closest you could have is a three seperate variables for the data types

Plus, I use this system in DBP, not that fast for me, probably due to my outdated machine, but there's a factor to consider...

Login to post a reply

Server time is: 2025-05-23 20:58:23
Your offset time is: 2025-05-23 20:58:23