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 / strikearona

Author
Message
himynameisali
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: England, You...Rastards!
Posted: 5th Mar 2004 21:24
as a mistake in dbpro forum, i was suppose to do it here! And I'm making a game called strikearona and its a third person shooter and i need help on it, i need code for enemy collision and object collision please? It'll be good and greatful to have them!

ali - nukesoft



ali morrison
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 5th Mar 2004 21:43
Unless you want to get to grips with how DarkBasic normally handles collision I suggest you go over to http://www.nuclearglory.com and download the shareware version of their v2.03 collision dll. It is very well documented, and only costs $15 for the full version. Careful about just asking for straight code, though. It makes others see you as trying to take the easy way out and not figure out the code for yourself. For starting any type of game I recommend looking at the Binary Moon tutorial. It covers everything from basic variables to collision and physics.

Crazy Donut Productions
Current Project: KillZone
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 5th Mar 2004 22:36
@crazy doughnut productions: will people stop advertising the Nuclear Glory DLL please, there IS a rule about advertising on this forum, I`m getting fed up of it, every time someone asks for help they get an advert stuffed in their face instead

@Nukesoft: enemy and object collision in DB are the same thing, your enemy will be an object so you just need to know how to detect collision between objects, the commands you can use are

OBJECT COLLISION()
OBJECT HIT()

they will both return a value when a collision occurs, but OBJECT HIT will only return a value the first time it is called, you can use them like this, say you want to detect the collision of object 1(the player) and object 4(a monster), just do

collided=object collision(1,4)

when object 1 hits object 4 then the number placed in collided will be a 1, if there is no collision when this was checked then it will be 0, now suppose that you have bullets from the enemy machine gun, numbered from 100 to 132, you can just ask the collision detection to tell you the number of something colliding with your player (object 1) by telling it that the second object will be zero, this tells it to return the number of the colliding object rather than just a one or zero, like this

what_hit_me=object collision(1,0)

the number placed in the variable what_hit_me will be the number of the object that hiot the player, then all you have to do is to check if it was one of the machine gun bullets...eg

if (what_hit_me>100) and (what_hit_me<133) then health=health-20

will deduct 20 from the players health for every time a bullet hit him, then you need to check that the player is still alive by checking the state of the health value, if the bullet was alive for a long time (ie: traveled a long way) then you can deduct less health to make it more realistic, hope thats some help.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 5th Mar 2004 22:47
@Mentor
I'm sorry about always just posting "GO NG" to every collision question that pops up, I didn't know it was bothering people. I'll take the time to become more familiar with standard DB collision and pass the word on to others to stop advertising.

Crazy Donuts

Crazy Donut Productions
Current Project: KillZone
himynameisali
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: England, You...Rastards!
Posted: 7th Mar 2004 13:30
I've made it now! I was on the PC for ages making it and I made it!
But the problem is, it won't work in EXE please tell me whats the problem?

ali morrison
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 8th Mar 2004 00:45
I noticed when I made my first exe it used a lot of media, and I had no screen to say "LOADING" or whatever, and it took a really long time to start up. Try not loading anything at the start except a loading screen, then load everything else while you're displaying the loading image.

Crazy Donut Productions
Current Project: KillZone

Login to post a reply

Server time is: 2025-05-23 09:08:47
Your offset time is: 2025-05-23 09:08:47