How should I handle objects in a game engine if I have say 200 unique in game objects without doing this:
do
;;skip actual code since it's placeholder example only
handleenemytype1(camerax, cameray, scrollx, scrolly, playerx1, playery1, playerx2, playery2)
handleenemytype2( ...)
etc..
loop
What i'm asking is how can I do this type of thing in a more generic way?
Quote200 unique in game objects
What's unique about them ?
They're of different types. So different values would need to be accessed. Different conditions would also apply.
For example certain enemies can fly others can't, certain enemies fly at a faster speed than others.
The flying trait won't even be included in enemies that can't fly.
Various other things, such as how many animation frames each one has.
Different enemies are going to need unique data sets because certain collision detection only occurs between specific enemy types as well.
Certain enemies can interact with tiles or world objects and others can't.
If you have lots of different 'structures' then you need lots of different code to drive them, let alone setting up 200 different structures. Nothing you've outlined requires it. It doesn't matter if the car object doesn't fly, as long as the structures are inherited from the from common parents.
[pbcode]
Type GeneralObject
EndType
Type Car as GeneralObject
EndTYpe
Type Van as Car
EndType
etc.
[/pbcode]