Aidos
Aidos copied to clipboard
Where to add Player instance in order to get instance of Player everywhere in the code
So far I feel Player belongs to a scene and should be placed in classes that represent levels like Sandbox class. Also I feel entities(player, enemies and other things) should be a part of scene only.
What are your opinions ?
Already posted in the Pull Request, but to reiterate, I think this is a good idea too. Maybe we could have a seperate class to keep the adding functions in?
Sandbox.EntityListObject.addEntity(e);
Kind of thing? To keep Sandbox clean, but still be able to have more verbose validation on functions like addEntity().
Yeah we can have something similar. This object can have methods like removeDeadEnemies( ) , addEnemyToScreen( ) , checkEnenmyCollisionWithPlayer( ) I think its a good idea to separate such functions to from sandbox class.
Sounds good, though I think "checkEnenmyCollisionWithPlayer( )" would be inside each enemy, rather than a global check, wouldn't it?
I feel having it local to entity is better as I feel otherwise the function will be large and complicated as it will have special case for different types of enemies.
Agreed