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.

Dark GDK / i need help with cloneing objects

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 23rd Apr 2008 23:53
I am trying to make a first person shooter, but there is a huge problem

Every time you click a bullet comeout of the gun-- Porblem is that if you hold down the left mouse button, the bullet just appears in front of the gun

I know I need to clone an object in order to make it work, but I dont really know how to clone objects.

Any help? Ideas?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 04:08
DarkBasic Pro has VERY SIMILIAR commands to DarkGDK (minus the C++ semantics of course.) you PROBABLY want an array of bullets. And then update all the moving bullets in flight. Alternatively, if you don't need to see them, you can use sparky's dll to just raycast from gun barrel to bullt range and see where it hits.

If you look at this: http://code.google.com/p/ironinfantrydbpro/ Grab ALL the files for it - the EXEs, and the source/media bundles... so the EXE's can work. See how it plays - it'll be fun, then open up the code and see how I did. there are alot of keypresses I recommend reading, maybe printing the README.TXT.

See if that helps.

As for C++ and Arrays, you can start with a fixed array.. its easier, then when you start getting the hang of it, you can maybe try your hand at dynamic arrays, either vectors using the STDLIB or make your own class that handles it.

Have fun man. (Its kind of multi-level what you asked, I think looking at something that works, you can actually kinda of play a game, see it work, then see the source code... I think it will give you ideas. The source files are broken into categories so it shoudl be somewhat easy to find the bullet code for either the helicopter, the tank, the tank machine gun etc.)

Have fun... welcome!

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 24th Apr 2008 05:39
Thanks for the game-- it was really cool--

One problem was that I couldn't see the .cpp version of the game

This meaning that I only had the compiled version. So I will try and figure it out-- outherwise -- COOL GAME! I WANT TO MAKE STUFF LIKE THAT SO BADLY!!!!!!!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 07:24
Well.. you will be able to make stuff like that if you stick it out... its not easy. And the point I wanted you to study is buried in the files that have the *.dba file extensions. Thats DarkBasic. If you can read C++, you should be able to find the file... say IITank.dba, and see how I did my bullets by studying the code.

P.S. Glad you liked it! Did you fly a heli? Or just drive the tank? Try out camera views? There is an observer mode.. I think "O".. then the function keys are all different views outside vehicles.

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 24th Apr 2008 14:57
yeah, I viewed all of that, the heli was too hard for me to fly, ended up crashing because I didn't exactly know what to do
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 16:09
LOL - I can appreciate that. Did you have the Readme.txt printed as a reference? That would help. Also once in air, you look around with mouse, zoom with mouse wheel, and shoot with left mouse button. You my second person to say the controls were hard. Must keep ears open. So far I have more people who like them than that don't. If the don't likes become more notable, I will have to investigate! (Though new version will have joystick for heli's and planes)

Back to topic. Bullets. The Heli shoots, the tank shoots 2 kidns of guns, and that's it. So you want to see how I conceptually made them work in IITank.dba and IIHeli.dba there might be a bullet source file but I dont think so.

The tank's big gun lanches a projectile, I thnk the tank machine gun does also. But the heli uses a ray tracing deal via sparky's dll.

Login to post a reply

Server time is: 2024-09-29 17:30:11
Your offset time is: 2024-09-29 17:30:11