|
|
Despite recent madness and lack of time, we have a basic untested collisionManager class, its in eva, and should be initialized in state, and ticked in state as well. gfx should be the one to get the collision list, so that it knows what ships should be sinking (and animate those).
potential problem: You have to get the bounding box off of the entity, not its node. The ents in the entity list are not the entities, just the dictionary representation, so we need to either get the entity from the gfxNode (hopefully the entity can be found using getAttachedObject and the entity's name). The other way requires the SceneManager (and getEntity()), and would then require collisionManager to be initialized and ticked in gfx instead of state (so that the SceneManager exists already and is accessible). Currently it is in state and uses the gfxNode, but this is untested.
another concern is making sure we don't test for collisions between an ent and itself. I wasn't sure what we could use for this, ent names maybe, or positions, (since hopefully it would detect collision before the boats have actually reached exactly the same position.) It currently uses the names, and hopefully that will handle it.
I'm not sure about using the random function to decide when to check for collision and when not to. The small chance that the generator produces a string of small numbers (or large) would mean that collisions would be checked too often (and slow everything down) or too little (and risk missing collisions). It may be better to have a set time like the toggle in gui.
Categories: None
The words you entered did not match the given text. Please try again.
Oops!
Oops, you forgot something.