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 / making multiple enemies?

Author
Message
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 6th May 2005 01:59
how would you make multiple enmies in a game and program them all, i could just make each one separetly but there must be an easier way? can anyone help? thanks

"Well, if he dies, it'll teach him not to do it again." - Me
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 6th May 2005 02:40
Yes I'm searching for multiple enemies too
With a triange as line of sight. (glued to the head)
And waypoints

Download Desert Dead DBCFPS at http:\\www.onlineartsgames.de
DBAlex
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 6th May 2005 05:41 Edited at: 6th May 2005 05:42
do something like:



(before the main do loop)

and then have something like this in game:


that makes simple enemy cubes that move towards the player if your using camera 0...can be apapted easily though.


AMD 64 3000 + 512mb RAM + 80GB HD + Radeon 9600se 128mb
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 6th May 2005 18:31
Arrays are your friend.

Crazy Donut Productions
Current Project: A Redneck game
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 6th May 2005 20:41
I cant use Arrays.
x$= are boxes

I want to position every box 1000 from the other one in a line
position object x$,0,0,100??????????

Download Desert Dead DBCFPS at http:\\www.onlineartsgames.de
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th May 2005 20:43
I think this can be helpful:

Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 7th May 2005 00:39
here we go, a little array helper



this should help, if there is anything you don't understand then just say

The happenings of tommorow are behind us now
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 7th May 2005 02:21 Edited at: 7th May 2005 02:22
...and maybe commands like this:


1. Jay is a enemy model

create_enemy(jay),1000,100,1000 rem create and position
and then....
add_current_enemy_waypoint_one (there are diffrent waypoint-ways this will glue the last created enemy to waypoint one)

IS THIS POSSIBLE?
(I search a "Array-Master" for my team)

Download Desert Dead DBCFPS at http:\\www.onlineartsgames.de
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th May 2005 02:53
ahhh, i think i get it, right, what if i did this:

i make lots of objects (from 5 to 20 or something) and call them all x, and in the loop i make them all follow you etc... and if you wanna shoot one and the bullet collides with object x then kill that object, but not the rest....


would that work?

"Well, if he dies, it'll teach him not to do it again." - Me
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 7th May 2005 03:32
Yes It is possible (remember Iced)

Download Desert Dead DBCFPS at http:\\www.onlineartsgames.de
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th May 2005 06:10
ahhh, good point

"Well, if he dies, it'll teach him not to do it again." - Me
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th May 2005 06:12
now what i need to do is roughly work out what enemy your pointing at, because i want the bullet to move at the spped of the distance between the player and the enemy that your looking at so that it hits them instantly...any ideas? i was thinking about you line of sight triangle thing...im just not too good with coliision

"Well, if he dies, it'll teach him not to do it again." - Me
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 7th May 2005 06:23 Edited at: 7th May 2005 06:26
Yes, this is a good thread for me as I would like to know how you can have friendlies and enemies attacking each other as well as the player

The thing that gets me is ID can you do say PlayerIDand enemy ID? and would that be in variables?
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th May 2005 18:45 Edited at: 7th May 2005 18:46
i'd say you'd do that with arrays

EDIT: does anyone have a custom raycasting command? (where you know if an enemy is right infront of you?)

"Well, if he dies, it'll teach him not to do it again." - Me
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th May 2005 20:42
Hehe, a raycasting function isn't very easy you know. Why dont you try it?

i think it should be something like:


I didn't test it so it could be wrong!
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th May 2005 21:16
lol, nup sorry doesnt work...

p.s. i know how hard it is to make a raycastic function lol, tried alot of times



"Well, if he dies, it'll teach him not to do it again." - Me
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th May 2005 22:28
Two alien tribes attacking each other? This is the theory, and the code. It doesn't cover the graphics though...

http://www.thegamecreators.com/data/newsletter/newsletter_issue_28.html#9

It's for DB Pro, but if you use the right editor, you can use Types.

BatVink
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 23rd Jul 2005 02:52
@BearCDP:

I soooo agree...
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Jul 2005 03:31
(3 months later....)

Your signature has been erased by a mod because it's larger than 600x120...

Login to post a reply

Server time is: 2025-05-22 19:50:08
Your offset time is: 2025-05-22 19:50:08