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 / Enemy Trouble

Author
Message
Urist McCoder
18
Years of Service
User Offline
Joined: 27th Sep 2005
Location: At the computer.
Posted: 12th Sep 2009 23:02 Edited at: 12th Sep 2009 23:03
I'm trying to figure out how to make enemies in a game, but I'm having trouble getting them to be more advanced than doing x amount of damage each hit and getting killed after you attack them once. I almost got it to work (I think), but the coding got really complicated and messy. I used "For t=x to y" to make them, but I'm not sure if it would work with all of them having separate life variables or if it would make them all die when one dies. Do I have to make each one individualy, or is their a different way?
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Sep 2009 23:51
Are you talking about controlling multiple enemies at once?

Easy stuff. Instead of saying "enemy_life=1" you can set up an array:



You can then control multiple enemies in a for-to loop. You just have to change every variable the enemy uses into an array.

theComet


Make the paths of your enemies easier with WaypointPro!
Urist McCoder
18
Years of Service
User Offline
Joined: 27th Sep 2005
Location: At the computer.
Posted: 13th Sep 2009 00:20 Edited at: 13th Sep 2009 00:32
Great! Thanks TheComet. That was exactly what I needed to know. Now I can finally make more than one enemy in a place.

Login to post a reply

Server time is: 2024-05-01 23:34:19
Your offset time is: 2024-05-01 23:34:19