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.

Newcomers DBPro Corner / How to keep track on enemies?

Author
Message
PaTTE
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 18th Mar 2007 15:25
For my game I need to keep track on a huge amount of enemies and their ships and stats.
I tried to make some user defined types for that. One for the enemy and another for his ship that contains all the info like hitpoints, shields...

But how would I create the enemies from this info so I could alter the hitpoints and such variables later?

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 18th Mar 2007 15:49 Edited at: 18th Mar 2007 15:51
After you have declared your type you can apply an array to its usage.

you can use it game elements as well, like this example.



Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Mar 2007 03:43
Just adding to this, if you have say 2000 enemies, is FOR/NEXT a good way to handle them? Is there another way?

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th Mar 2007 04:02
that's how I do it many times in my game and it doesn't seem to slow down at all


indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 24th Mar 2007 04:55
sixty is right i should have covered that aspect to this example

so in essence the 1 2 and 3 integers in that example could be crunched into a loop

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Mar 2007 15:34
Okay. Thanks Gil Galvanti and indi.

Login to post a reply

Server time is: 2024-11-25 22:41:52
Your offset time is: 2024-11-25 22:41:52